You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since programs made by the compiler are never evaled in the compiler scope, macros cannot make reference to functions that are defined in the program except through use in expanded forms, so it is difficult to make use of libraries to handle the arrays, and what ever other various things you might do inside of a macro, with our directly defineing them in the macro, or using a meta tag to append the functions definition to the global scope.
Even then, if you have a set of functions that operate on arrays that you like to use in general, for every function there must be two definitions
(defuny (a b) `(cdr (list,a ,b)))
(defmacrox (a b) (y a b))
(let ((a 0) (b 1))
(x a b));;(x a b) -expands to-> (CDR (LIST A B))
The above is some common lisp, here there was a function y defined, and it was then used inside of the macro x.
to do the same thing in sibilant right now would require the following.
;;not valid.
(def y (a b) `(cdr (list @a @b)))
(macro x (a b) (y a b))
;;valid
(macro x (a b)
(def y (a b) `(cdr (list @a @b)))
(y a b))
Which then makes using y in other macros impossible.
This could be solved by evaluating every form defined immediately after expansion.
The text was updated successfully, but these errors were encountered:
Since programs made by the compiler are never evaled in the compiler scope, macros cannot make reference to functions that are defined in the program except through use in expanded forms, so it is difficult to make use of libraries to handle the arrays, and what ever other various things you might do inside of a macro, with our directly defineing them in the macro, or using a meta tag to append the functions definition to the global scope.
Even then, if you have a set of functions that operate on arrays that you like to use in general, for every function there must be two definitions
The above is some common lisp, here there was a function y defined, and it was then used inside of the macro x.
to do the same thing in sibilant right now would require the following.
Which then makes using y in other macros impossible.
This could be solved by evaluating every form defined immediately after expansion.
The text was updated successfully, but these errors were encountered: