David Kastrup <d...@gnu.org> writes: > David Kastrup <d...@gnu.org> writes: > >> The module system documentation provides _no_ _clue_ _whatsoever_ about >> how something like >> (symbol-set! #f (string->symbol name) value) >> could be replaced. In fact, the module system documentation provides >> _no_ _clue_ _whatsoever_ how to actually access module variables short >> of calling eval on little programs working with symbols. >> >> I don't want to call eval for the simple act of setting a symbol to a >> value. >> >> The funny thing is that symbol-fset! and symbol-pset! are documented. >> But nothing whatsoever that could set a symbol value itself on a symbol >> that has been generated. >> >> What's up with that? > > Well, I disassembled enough to come up with > (module-define! (current-module) (string->symbol name) value) > > It is not like there is _any_ documentation for this in the manual. > > Is this somebody's idea of a joke?
Apparently. The C interface offers scm_define which works fine for this purpose. But on the Scheme side, there is _no_ equivalent to Lisp's set (rather than setq or setf). What is one supposed to do? (define-macro (mydef! name . rest) `(define ,(primitive-eval name) ,@rest)) Is this supposed to be a puzzle? Why is there _no_, I repeat _no_ documented way of setting a symbol that is not given literally to a value? Neither in the straight way (as with C's scm_define which is a function rather than a macro and thus useful for this purpose), nor in connection with modules (since neither module-define! nor module-set! are documented anywhere). -- David Kastrup