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: intern a top level variable

2023-08-16 Thread Mortimer Cladwell
> is the name of the variable only going to be known when the program has already begun running yes the values of name and data will be substringed from an argument passed to the method at runtime Thanks Mortimer On Wed, Aug 16, 2023 at 4:35 PM Taylan Kammer wrote: > On 16.08.2023 21:17, Morti

Re: intern a top level variable

2023-08-16 Thread Taylan Kammer
On 16.08.2023 21:17, Mortimer Cladwell wrote: > 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

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

Re: intern a top level variable

2023-08-16 Thread tomas
On Wed, Aug 16, 2023 at 08:41:18AM -0400, Mortimer Cladwell wrote: > Hi, > How do I intern a top level variable? You don't intern variables, you intern symbols (now I guess you know that, but then: what are you trying to do?) > looks like intern-symbol is > deprecated? Is t

intern a top level variable

2023-08-16 Thread Mortimer Cladwell
Hi, How do I intern a top level variable? looks like intern-symbol is deprecated? Is there a substitute? gensym does not seem to be it: scheme@(guile-user)> (gensym "abc") $11 = abc2652 scheme@(guile-user)> abc2652 ;;; : warning: possibly unbound variable `abc2652' ERROR