Re: Re: intern a top level variable

2023-08-20 Thread Jean Abou Samra
Le mercredi 16 août 2023 à 15:17 -0400, Mortimer Cladwell a écrit : > I would like to define a variable within a method but make it available to the > entire module - globally. [...] > So yes I will need to read more about interning. OK, so the reason we were all confused is that "interning" is a

Re: Re: intern a top level variable

2023-08-16 Thread Mortimer Cladwell
I would like to define a variable within a method but make it available to the entire module - globally. Take a string "abc" convert to a variable (symbol??) abc and set to the string value "def". The values of name and data are unknown - they are variable. In this example the variable (symbol??) a

Re: Re: intern a top level variable

2023-08-16 Thread tomas
On Wed, Aug 16, 2023 at 06:13:05PM +0200, Jean Abou Samra wrote: > Le mercredi 16 août 2023 à 10:55 -0400, Mortimer Cladwell a écrit : > > I would like to intern and assign a value within a method: > > > > (define (test-intern) > > (let* ((name "abc") > >    (data "def") > >    (name-symbo

Re: Re: intern a top level variable

2023-08-16 Thread Jean Abou Samra
Le mercredi 16 août 2023 à 10:55 -0400, Mortimer Cladwell a écrit : > 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

Re: Re: intern a top level variable

2023-08-16 Thread Mortimer Cladwell
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-inte