[fpc-pascal] An idea for a "pair" type

Sven Barth pascaldragon at googlemail.com
Wed Dec 16 18:50:52 CET 2020


Ryan Joseph via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am
Mi., 16. Dez. 2020, 18:38:

> Just for fun I wanted to see what people thought about a potential "pair"
> type added to the compiler. Dictionaries have proven themselves to be a
> fundamental type we use often and they are appearing as built-in syntax in
> many languages, especially scripting languages that allow dynamic object
> construction.
>
> So my idea was a potential "pair of ..." type added to the compiler which
> accepts pair literals in the format of "key: value". The underlying
> structure would be a record like "_Pair".
>
> The primary reason for this is so we can construct dictionaries easier but
> they could also be used for other reasons, although I'm not sure that would
> be sensible.
>
> Seems like low hanging fruit to me but I'm curious what other people think.
>

This can simply be done using existing language constructs, no need to
introduce anything new.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20201216/ab6ec75c/attachment.htm>


More information about the fpc-pascal mailing list