tomhrr / dale

Lisp-flavoured C
BSD 3-Clause "New" or "Revised" License
1.02k stars 48 forks source link

I can't use forms inside uq, but have to create a temporary variable #140

Closed porky11 closed 6 years ago

porky11 commented 7 years ago
(import macros)

(using-namespace std.macros
  (def test (macro intern (void)
    (qq identity (uq (mnfv mc 1))))))

(def main (fn extern-c void (void)
  (printf "%i\n" (test)))) 

(test) expands to (identity (mnfv mc 1)) instead of (identity 1)

porky11 commented 7 years ago

Similar problem with uql: (qq (uql (fun arg))) will expand correctly, but fun is called twice, which leads to problems in some cases.

tomhrr commented 6 years ago

Thanks, these problems have now been fixed.