unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Re: Re: intern a top level variable
@ 2023-08-16 14:55 Mortimer Cladwell
  2023-08-16 16:13 ` Jean Abou Samra
  0 siblings, 1 reply; 7+ messages in thread
From: Mortimer Cladwell @ 2023-08-16 14:55 UTC (permalink / raw)
  To: guile-user, tomas

I would like to intern and assign a value within a method:

(define (test-intern)
(let* ((name "abc")
       (data "def")
       (name-symbol (gensym name))
       )
  (pretty-print (string-append "symbol: " (symbol->string name-symbol)))
  (set! name-symbol data)))

scheme@(guile-user)> (test-intern)
"symbol: abc3301"
scheme@(guile-user)> abc3301
;;; <unknown-location>: warning: possibly unbound variable `abc3301'
ERROR: In procedure module-lookup: Unbound variable: abc3301

Thanks


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-20 13:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-16 14:55 Re: intern a top level variable Mortimer Cladwell
2023-08-16 16:13 ` Jean Abou Samra
2023-08-16 17:58   ` tomas
2023-08-16 19:17   ` Mortimer Cladwell
2023-08-16 20:35     ` Taylan Kammer
2023-08-17  6:07       ` Mortimer Cladwell
2023-08-20 13:56     ` Jean Abou Samra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).