Code: Select all
(define (car lst)
(if lst(first lst)nil))
(define (cadr lst)
(if lst(first(rest lst))nil))
(define (read readstr readret)
(cond
((float readstr)
(if (find "." readstr)
(setq readret (float readstr))
(setq readret (integer readstr))
)
)
((=(slice readstr 0 1)"(")
(setq readret(eval-string(append "'" readstr)))
)
(true
(setq readret (symbol readstr))
)
)
)
(define-macro (strcat _startstr)
(if (not(string? _startstr))
(setq _startstr (eval _startstr)))
(if (args)
(dolist (_strcatx (args))
(if (string? _strcatx)
(setq _startstr(append _startstr _strcatx))
(setq _startstr(append _startstr (eval _strcatx)))
)
))_startstr)
(define-macro (foreach _foreachx _foreachlst)(eval (list 'dolist (list _foreachx _foreachlst) (append (list 'begin) (args)))))
Code: Select all
(foreach lst (list (list "MySym" "MyVal"))(set (read(strcat(car lst))) (cadr lst)))
call stack overflow in function set : if
called from user defined function read
called from user defined function read
called from user defined function read
called from user defined function read
called from user defined function read
called from user defined function read
called from user defined function read
called from user defined function read
called from user defined function read
called from user defined function read
called from user defined function read
...
...
Any hints?