Scriptor / pharen

Lisp to PHP Compiler
http://pharen.org
BSD 3-Clause "New" or "Revised" License
218 stars 31 forks source link

macro example with makelist doesn't compile #26

Closed francescoagati closed 13 years ago

francescoagati commented 13 years ago

with this macro

(defmacro make-list (&args) '[~@args]) (make-list 1 2 3 4 5)

i have this error

Fatal error: Call to a member function compile() on a non-object in /Users/Francesco/Downloads/Scriptor-pharen-1266893/pharen.php on line 1418

francescoagati commented 13 years ago

doesn't work this issue and the last.

If i put the 2 code of issue toghever:

(defmacro fn-generator-test (nm value) '(fn ~-nm () (def stuff "foo") (. stuff ~value))) (fn-generator-test "generated_test_fn" "bar")

(defmacro make-list (&args) '[~@Args]) (make-list 1 2 3 4 5)

i have:

Warning: Invalid argument supplied for foreach() in /Users/Francesco/Downloads/Scriptor-pharen-0379207/pharen.php on line 1335

Scriptor commented 13 years ago

Should work now, however, it should be:

'[~@args]

Variables are case-sensitive so args should be lowercase. Otherwise the above code seems to work.