hi
I'm working on Perl variant of Lispscript. I have lot of questions and
ideas, but I'm tired, so right now I just wanna show you some first
results. I'm interested in your opinion if this is in spirit of
Lispyscript.
echo_pl.ls:
1 (my $echo (sub ($foo $bar)
2 (print $foo $bar)))
3 ($echo "hi" "you")
==>
echo_pl.pl:
1 my $echo = sub() {
2 my ($foo,$bar) = @_;
3 return print($foo);
4 };
5 $echo->("hi","you");
notes:
- I tried to stay as close as possible to the JS variant
- decided not to hide Perl's context sensitivity, therefore the sigils
($echo) are needed
- in javascript there is no difference in calling a function or a
closure in perl there is, therefor I added the 'ffi' keyword:
* (print str) is in fact (ffi print (str)), that in turn is wrapped in
macro called 'print'
regards
ben