Sujet : Re: Top 10 most common hard skills listed on resumes...
De : antispam (at) *nospam* fricas.org (Waldek Hebisch)
Groupes : comp.lang.cDate : 08. Sep 2024, 19:39:35
Autres entêtes
Organisation : To protect and to server
Message-ID : <vbkr15$27l2o$2@paganini.bofh.team>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
Bart <
bc@freeuk.com> wrote:
But the feature (using them in lvalue contexts) was rarely used.
(** This is:
(a, b, c) = 0;
in C, which is illegal. But put in explicit pointers, and it's suddenly
fine:
*(a, b, &c) = 0;
So why can't the compiler do that?)
The second really is
(a, b, c = 0);
I do not know what you expect writing '(a, b, c) = 0', but the above
C meaning probably is not what you want.
I use language that allows:
(a, b, c) := (b, c, a);
that is if there are 3 things on left hand side, then there must
be 3 things on the right hand side. It also allows
(a, b, c) := l;
but then l must be a list or record of 3 things (and entries in
order are assigned to things on the left hand side).
(a, b, c) := 0;
would be valid only if '0' happended to be approprate list or record
so that case above would apply. '0' is overloaded and user definable
so user in principle could do that. But no sane person would
define such '0'.
BTW, in Pop11 this is
(1, 2, 3) -> (a, b, c);
and if you write
0 -> (a, b, c);
it assigns 0 to 'c' and grabs two items from the stack and assigns
them to 'a' and 'b' (empty stack signals error).
-- Waldek Hebisch