Re: [racket-users] A dict? question

2021-02-27 Thread 'William J. Bowman' via Racket Users
Exactly. `'e` is a reader macro that gets read as `(quote e)`.
When it's already under a quote, the quoted quote is treated as a symbol:

> (dict-ref '('yay) 'quote)
'(yay)
> (quote ((quote yay)))
'('yay)
> '((quote yay))
'('yay)
> (dict-ref '((quote yay)) 'quote)
'(yay)

--
William J. Bowman

On Sun, Feb 28, 2021 at 01:45:56AM +0200, Yury Bulka wrote:
> Indeed,
> 
> > (dict-keys '('yay))
> '(quote)
> > (dict-values '('yay))
> '((yay))
> > (dict-ref '('yay) 'quote)
> '(yay)
> 
> So... this boils down to:
> 
> > (equal? '('yay) '((quote yay)))
> #t
> 
> --
> Yury Bulka
> https://mamot.fr/@setthemfree
> #NotOnFacebook
> 
> 
> 
> William J. Bowman  writes:
> 
> > try (dict-ref ‘(‘yay) ‘quote)
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/87k0qtf51n.fsf%40privacyrequired.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/YDraI2UWIH3ejIN3%40williamjbowman.com.


Re: [racket-users] A dict? question

2021-02-27 Thread Yury Bulka
Indeed,

> (dict-keys '('yay))
'(quote)
> (dict-values '('yay))
'((yay))
> (dict-ref '('yay) 'quote)
'(yay)

So... this boils down to:

> (equal? '('yay) '((quote yay)))
#t

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



William J. Bowman  writes:

> try (dict-ref ‘(‘yay) ‘quote)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87k0qtf51n.fsf%40privacyrequired.com.


Re: [racket-users] A dict? question

2021-02-27 Thread 'William J. Bowman' via Racket Users
try (dict-ref ‘(‘yay) ‘quote)

-- 
Sent from my phoneamajig

> On Feb 27, 2021, at 15:31, Yury Bulka  wrote:
> 
> Dear Racketeers,
> 
> I have noticed something I don't understand:
> 
>> (dict? '(yay))
> #f
>> (dict? '('yay))
> #t
>> (dict-ref '('yay) 'yay)
> ; dict-ref: no value for key: 'yay in: '('yay)
> 
> I'm puzzled - what makes '('yay) a dict compared to '(yay)?
> 
> (Running Racket 7.8 on Linux).
> 
> --
> Yury Bulka
> https://mamot.fr/@setthemfree
> #NotOnFacebook
> 
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/87mtvpf5pa.fsf%40privacyrequired.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/B540457B-D95F-4C18-A978-90033951BA0C%40williamjbowman.com.


[racket-users] A dict? question

2021-02-27 Thread Yury Bulka
Dear Racketeers,

I have noticed something I don't understand:

> (dict? '(yay))
#f
> (dict? '('yay))
#t
> (dict-ref '('yay) 'yay)
; dict-ref: no value for key: 'yay in: '('yay)

I'm puzzled - what makes '('yay) a dict compared to '(yay)?

(Running Racket 7.8 on Linux).

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87mtvpf5pa.fsf%40privacyrequired.com.