News for hackers. Stuff that matters.

oct

Re:Block Comments Are a Bad Idea on Wednesday October 11, 2017 @08:07AM (#15449052)
OCaml actually has correct block comments by his definition (and no line comments). This does lead to the odd fact that you can't have an unterminated string literal in a comment, which usually isn't a problem, but can be surprising.
Re:Esoteric Topics in Computer Programming (2002) on Friday September 16, 2016 @07:10AM (#12513178)
I think you're thinking of `true`.
Re:Python wats on Saturday October 10, 2015 @09:34PM (#10367690)
OCaml's parsing rules are pretty opaque sometimes. For example, if you have an "if" statement that's just performing effects (not returning a value), you may run into behavior like this:

    # let x = ref 0;;
    val x : int ref = {contents = 0}
    # let y = ref 0;;
    val y : int ref = {contents = 0}
    # if false then
        x := 1;
        y := 1;
      ;;
    - : unit = ()
    # (!x, !y);;
    - : int * int = (0, 1)
    # y := 0;;
    - : unit = ()
    # if false then
        let z = 1 in
        x := z;
        y := z;
      ;;
    - : unit = ()
    # (!x, !y);;
    - : int * int = (0, 0)
Re:Reading Lamport, again on Thursday June 26, 2014 @11:54PM (#7952676)
The causal ordering defined in the paper is stronger than that. It says that if process P performs event A and later sends a message to process Q, then any event that occurs in Q after Q receives the message causally follows A. I don't think the blog post was meant to imply that the order of events within a single process does not need to be respected, though it doesn't specifically distinguish the single process case.
Just because Haskell is purer that doesn't mean ML is pointless. Under the right circumstances even a functional program can benefit from mutable state. One example (perhaps the only real example; I don't know) can be found in the SML New Jersey implemetation of splay trees, which modifies the tree during certain operations.

Even without the purity question there are other things to consider. ML is evaluated strictly, for example. I don't know much Haskell but I don't believe it has any direct counterpart to ML's functors, either. There are probably many other differences. Haskell is definitely more popular and is still a niche language, so the reason you don't hear much about ML's benefits is probably just because it has so few users.

Re:Dynamic languages are static languages on Sunday March 20, 2011 @06:25PM (#2347604)
I am pretty sure the Carnegie Mellon remark was just saying that a CMU CS graduate would have learned this already. Which is true, since the blog author (Bob Harper) teaches a course there which covers this very topic!
Is there precedent for this? I can recall stories about getting cut off from a service if modding is detected but not about this sort of thing.
Re:Eggcorn on Friday July 09, 2010 @10:06PM (#1502864)
I thought for a while that the word being used was "bellicose," like they were being confrontational by bulging out.
Re:Why Johnny can't code on Tuesday June 22, 2010 @01:44AM (#1451070)
Here is a recent HN discussion of the same article: http://news.ycombinator.com/item?id=1448424
Re:Common False Beliefs in Mathematics on Sunday June 06, 2010 @11:24AM (#1408587)
Apostol's Calculus would probably fit your needs. I do not remember its discussing applications at all, unlike the Salas and Hille book according to online descriptions of it. From what you wrote it does not look like you are concerned with that, though.
This is a good description of my position as well. Unfortunately it seems like this is something that does not get taught at schools much, and I will admit to having been trying to learn everything from school when I should be doing more independent work. Does anyone know any useful resources on how to proceed from this point? Or does it require just working on a larger-scale project and figuring things out along the way?