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
It would be nice to be able to get the namespace in introspection
Needed functions: (symbol-namespace mc name) returns namespace of a variable or extern-c function (symbol-namespace mc name args) returns namespace of a function or macro called with args (current-namespace mc) returns the current namespace used by macro (parent-namespace mc namespace) returns the parent namespace of a namespace
Some macro, that would be useful too:
since . means root namespace .. may mean parent-namespace too
(using-namespace std.macros
(import macros)
(import cstdlib)
(def debug (macro intern (name rest) ;;use some debug-version of the function
(def args (var auto \ (get-varargs-list mc (- (arg-count mc) 1) rest)))
(def namespace (symbol-namespace name args)) ;;namespace of a symbol which takes args as arguments
(if (not (null args))
(qq using-namespace (uq namespace)
(uql args))
(do
(make-node mc)))))
(namespace a
(def a (fn intern void (void)
(printf "a\n")))
(namespace debug
(def a (macro intern (rest)
(printf "called a with wrong number of arguments\n")
(exit 1)
(make-node mc)))))
)
(def main (fn extern-c void (void)
(using-namespace a
(using-namespace b
(debug a)
(debug a 1))))
The text was updated successfully, but these errors were encountered:
It would be nice to be able to get the namespace in introspection
Needed functions:
(symbol-namespace mc name)
returns namespace of a variable or extern-c function(symbol-namespace mc name args)
returns namespace of a function or macro called with args(current-namespace mc)
returns the current namespace used by macro(parent-namespace mc namespace)
returns the parent namespace of a namespaceSome macro, that would be useful too:
since
.
means root namespace..
may mean parent-namespace tooThe text was updated successfully, but these errors were encountered: