Lists as dictionaries
Marc Nieper-Wißkirchen
(20 Jul 2021 17:07 UTC)
|
Re: Lists as dictionaries
Lassi Kortela
(20 Jul 2021 17:17 UTC)
|
Re: Lists as dictionaries
Marc Nieper-Wißkirchen
(20 Jul 2021 17:23 UTC)
|
Re: Lists as dictionaries Lassi Kortela (20 Jul 2021 17:23 UTC)
|
Re: Lists as dictionaries
Marc Nieper-Wißkirchen
(20 Jul 2021 17:29 UTC)
|
Re: Lists as dictionaries
John Cowan
(20 Jul 2021 17:39 UTC)
|
Re: Lists as dictionaries
Marc Nieper-Wißkirchen
(20 Jul 2021 17:54 UTC)
|
Re: Lists as dictionaries
John Cowan
(20 Jul 2021 20:50 UTC)
|
Re: Lists as dictionaries
Marc Nieper-Wißkirchen
(20 Jul 2021 20:58 UTC)
|
Re: Lists as dictionaries
Dr. Arne Babenhauserheide
(21 Jul 2021 18:27 UTC)
|
Re: Lists as dictionaries
John Cowan
(22 Jul 2021 00:25 UTC)
|
Re: Lists as dictionaries
Marc Nieper-Wißkirchen
(22 Jul 2021 05:38 UTC)
|
Re: Lists as dictionaries
John Cowan
(22 Jul 2021 23:21 UTC)
|
Re: Lists as dictionaries
Marc Nieper-Wißkirchen
(23 Jul 2021 06:13 UTC)
|
> Unless another mechanism is employed (for example a type descriptor as > the first argument), Would this work? ;; SRFI implementation: (define alist-magic (gensym)) ; or some gensym-like thing we have (define plist-magic (gensym)) (define (alist-dict alist) (cons alist-magic alist)) (define (plist-dict plist) (cons plist-magic plist)) (define (alist-dict? obj) (and (pair? obj) (eq? alist-magic (car obj)) (define (plist-dict? obj) (and (pair? obj) (eq? plist-magic (car obj)) ;; Examples: (define foo '((a . 1) (b . 2) (c . 3))) (define bar '(a 1 b 2 c 3)) (dict-keys foo) ; is an error (dict-keys bar) ; is an error (dict-keys (alist-dict foo)) ; => (a b c) (dict-keys (plist-dict bar)) ; => (a b c)