[Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guards loops]
Richard A. O'Keefe
ok at cs.otago.ac.nz
Mon Jul 15 04:14:18 CEST 2013
On 12/07/2013, at 6:12 PM, Andreas Abel wrote:
[I can't try your F# example but ocaml does something different.]
Yes. They are different languages.
By the way, I used the F# that comes with Mono.
> On 12.07.2013 02:22, Richard A. O'Keefe wrote:
>> For what it's worth,
>>
>>> let x = 1 in
>> - let x = x+1 in
>> - let x = x+2 in
>> - x;;
>>
>> prints
>>
>> val it : int = 4
>>
>> in the F# interactive system, but
>>
>>> let x = 1 in
>> - let x = x+1 in
>> - let x = x+2 in
>> - x;;
>
> let p = e in body
>
> is just
>
> (\ p -> body) e
>
> it cannot be simpler than that.
True. But it *can* be more complex than that,
and in F# it *is*.
> So I do not see your point.
The differently indented versions of the nested let do
different things. Although F# is a descendant of Ocaml,
it is not the case that all "let"s in F# allow shadowing.
That's the point.
More information about the Haskell-Cafe
mailing list