Technically speaking, everything is a struct, both hashes and sets.
The difference is that the function make-base-namespace shares the
module that implements the struct for the hash tables and doesn't for
sets. You can share it yourself, if you want to, tho. (See
namespace-attach-module.)

Robby

On Thu, Jan 10, 2019 at 12:36 PM Jens Axel Søgaard
<jensa...@soegaard.net> wrote:
>
> A `set` is represented as a set structure. Structures are generative, so each 
> instantiation of the set structure gives you different structure types (even 
> though names and fields are identical). Creating a new namespace means you 
> get different set structures.
>
> A hash is not represented as a structure, so you will not see a difference 
> there.
>
> You can solve the problem with two different set structures by attaching the 
> original instantiation of the set module to your new namespace.
>
> tor. 10. jan. 2019 kl. 17.50 skrev 'Leandro Facchinetti' via Racket Users 
> <racket-users@googlegroups.com>:
>>
>> Please help me understand the following:
>>
>> #lang racket
>> (define s (eval '(begin (require racket/set) (set 1 2)) 
>> (make-base-namespace)))
>> s ;; ⇒ (set 1 2)
>> (set? s) ;; ⇒ #f (but I expected ‘#t’)
>>
>> --
>> Leandro Facchinetti <m...@leafac.com>
>> https://www.leafac.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> --
> Jens Axel Søgaard
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to