-
-
Notifications
You must be signed in to change notification settings - Fork 91
Closed

Description
On both OpenBSD amd64 and Snow Leopard I get the following.
[james@thinkpad potion]$ ./potion
>> add = (x, y): x + y.
=> function(x, y)
>> add(2, 4) string print
nil=> nil
>>
Is this expect behavior? I would think I would get 6 returned. All tests pass when I run make test yet calling a simple function doesn't?
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
ghost commentedon Nov 11, 2010
Yes, this is expected behavior because the scope in which the interactive interpreter runs commands changes with each line. In your example, on the second line,
add
wasnil
. If you seperated the lines with a comma, it would work:>> add = (x, y): x + y., add(2, 4) string print
6=> nil
#12: clear locals at vm init
perl11#12: clear locals at vm init