What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (20 Jul 2021 17:22 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (20 Jul 2021 17:46 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (20 Jul 2021 20:17 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (21 Jul 2021 06:24 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (22 Jul 2021 05:35 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (23 Jul 2021 06:08 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (24 Jul 2021 07:27 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (24 Jul 2021 21:39 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (25 Jul 2021 08:29 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (26 Jul 2021 07:04 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (27 Jul 2021 05:56 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (28 Jul 2021 06:19 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (30 Jul 2021 06:17 UTC)
Re: What about other mechanisms to support polymorphism? Dr. Arne Babenhauserheide (23 Jul 2021 20:38 UTC)
Re: What about other mechanisms to support polymorphism? Marc Nieper-Wißkirchen (22 Jul 2021 20:16 UTC)

Re: What about other mechanisms to support polymorphism? Dr. Arne Babenhauserheide 23 Jul 2021 20:38 UTC
John Cowan <xxxxxx@ccil.org> writes:

> I understand what nullary constructors are, but not why they are relevant
> to SRFI 225, which provides no generic constructors of any kind, the
> assumption being that the information required by a constructor is
> arbitrarily different for different dictionary types.

What happens if we remove the last entry from an alist and then add a
new entry? Can this turn it into a plist — or the other way round?

(dict-set! (dict-remove! (λ(x) #t) dict) 1 2)

One thing I’d like to see is an equivalent to assoc, i.e. dict-item:

(dict-item '((1 . 2)) 1)
;; => (1 . 2)
(dict-item '((1 . 2)) 2)
;; => #f

If an entry with the key exists, return the entry in the dictionary (car
as key, cdr as value), if it does not exist, return #f.

This allows distinguishing between value #f and not existing key,
without having to query the datastructure twice.

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken