let question

12 views
Skip to first unread message

Jonathan Aquino

unread,
Mar 5, 2014, 8:18:02 PM3/5/14
to lis...@googlegroups.com
If I do the following:

(use var_dump)
(let ([x 5]
      [y (+ x 1)])
  (var_dump y))

it prints out 1, not 6. So one let variable (y) can't refer to another let variable (x). Is that expected, or a bug?

Jonathan

홍 민희

unread,
Mar 5, 2014, 8:51:49 PM3/5/14
to lis...@googlegroups.com
That’s expected, and burrowed from Scheme’s semantics. We seem to need let* as well. See also: http://stackoverflow.com/a/16530812/383405
> --
> You received this message because you are subscribed to the Google Groups "Lisphp" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to lisphp+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Jonathan Aquino

unread,
Mar 6, 2014, 1:17:14 PM3/6/14
to lis...@googlegroups.com
I created a pull request for let*: https://github.com/lisphp/lisphp/pull/21

Jonathan
Reply all
Reply to author
Forward
0 new messages