Re:Measuring GC latencies in Haskell, OCaml, Racket
by OskarS on Monday December 05, 2016 @11:38AM
(#13106633)
Ah, I see, I figured that there might be some case like that. I would have expected that to be a compile-time error because `y` is an unrecognized identifier by the time `x` is defined, but I guess it makes sense with lazy evaluation to not make that kind of ordering matter.
[ Parent
| on HN ]
Re:Measuring GC latencies in Haskell, OCaml, Racket
by tener on Monday December 05, 2016 @03:14PM
(#13108987)
Lazy evaluation is not important item here. It is merely the semantics is defined in a way that the order of declarations does not matter.
Other languages have this property too - say, C# (not entirely true, but pretty close - at least if you think about top level methods etc.).
Also an example where the order of declarations does not matter at all, because there is just one declaration:
x :: [Integer]
x = 0 : 1 : x
Re:Measuring GC latencies in Haskell, OCaml, Racket
by hood_syntax on Monday December 05, 2016 @02:11PM
(#13108301)
Yeah, all definitions are module level unless they are scoped in let or where blocks (someone correct me if I'm mistaken)