[m-users.] use of list.chunk and head clause determinism

Volker Wysk post at volker-wysk.de
Sat Nov 20 21:41:39 AEDT 2021


Hi, Sean!

Am Samstag, dem 20.11.2021 um 10:24 +0000 schrieb Sean Charles
(emacstheviking):
> 
> So I guess the question is, should I use pair() right back at the start of
> the process or how would I inform the compiler in its language that I
> absolutely know and can guarantee that the received parameter is a list of
> size 2, always, for ever. Except when it’s empty. If I use pair() it
> affects other code that performs string conversions.

I don't fully understand what you're trying to do, but I'd simply use pair/2
or two-element-tuples. I looks messy in my eyes to have a list of keys and
values, taking turns. I'd expect the code to become clearer an less error
prone, if you do it with pair(a,b) or {a,b}.

Happy hacking,
Volker

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mercurylang.org/archives/users/attachments/20211120/825e7b57/attachment.sig>


More information about the users mailing list