Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 26 |
Nodes: | 6 (0 / 6) |
Uptime: | 56:11:34 |
Calls: | 632 |
Files: | 1,187 |
D/L today: |
27 files (19,977K bytes) |
Messages: | 179,568 |
On 14 Apr 2025 09:56:26 GMT, Stefan Ram wrote:
Lisp's cons cells are conceptual, not just syntax.
Is that why Lisp needs the separate concept of multi-value return, instead of doing simple destructuring assignment as both Python and JavaScript are able to do?
Ar an ceathr|| l|i d|-ag de m|! Aibre|in, scr|!obh Lawrence D'Oliveiro:CL provides multi-value-setq as a macro I think) and it does the obvious thing. Since the head of this thread has been lopped off, I don't know
> On 14 Apr 2025 09:56:26 GMT, Stefan Ram wrote:
>
> > Lisp's cons cells are conceptual, not just syntax.
>
> Is that why Lisp needs the separate concept of multi-value return, instead
> of doing simple destructuring assignment as both Python and JavaScript are
> able to do?
LisprCOs #'destructuring-bind is available. But the stack is right there (for most people, most of the time), why not make use it as a cheap way to return multiple values?
Ar an ceathr|| l|i d|-ag de m|! Aibre|in, scr|!obh Lawrence D'Oliveiro:
Is that why Lisp needs the separate concept of multi-value return,
instead of doing simple destructuring assignment as both Python and
JavaScript are able to do?
LisprCOs #'destructuring-bind is available. But the stack is right
there (for most people, most of the time), why not make use it as a
cheap way to return multiple values?
On Tue, 23 Sep 2025 20:28:19 +0100, Aidan Kehoe wrote:
Lawrence D'Oliveiro:
Is that why Lisp needs the separate concept of multi-value return,
instead of doing simple destructuring assignment as both Python and
JavaScript are able to do?
LisprCOs #'destructuring-bind is available. But the stack is right
there (for most people, most of the time), why not make use it as a
cheap way to return multiple values?
ThatrCOs an implementation issue, which is irrelevant to the way the
language works. Python lets you write
a, b = b, a
as an easy way to swap the values of variables, for example.
On Tue, 23 Sep 2025 20:28:19 +0100, Aidan Kehoe wrote:
Ar an ceathr|| l|i d|-ag de m|! Aibre|in, scr|!obh Lawrence D'Oliveiro:
Is that why Lisp needs the separate concept of multi-value return,
instead of doing simple destructuring assignment as both Python and
JavaScript are able to do?
LisprCOs #'destructuring-bind is available. But the stack is right
there (for most people, most of the time), why not make use it as a
cheap way to return multiple values?
ThatrCOs an implementation issue, which is irrelevant to the way the language works.
Python lets you write
a, b = b, a
as an easy way to swap the values of variables, for example.
ThatrCOs an implementation issue, which is irrelevant to the way the
language works. Python lets you write
a, b = b, a
as an easy way to swap the values of variables, for example.
What does this non-sequitur have to do with bindings (either
destructuring or multiple values)?
Mutation of bindings is handled in lisp through generalized references ("places") in a uniform way.
(let ((a 10) (b 20)) (rotatef a b) (list a b))
https://www.lispworks.com/documentation/HyperSpec/Body/m_shiftf.htm https://www.lispworks.com/documentation/HyperSpec/Body/05_a.htm
With time and maturity I have come to the realisation that there is
*always* an underlying machine and an underlying language
implementation ...
* Lawrence DrCOOliveiro <10b0cks$3i6j6$1@dont-email.me> :
a, b = b, a
What does this ... have to do with bindings (either
destructuring or multiple values)?
On Wed, 24 Sep 2025 14:03:40 +0100, Aidan Kehoe wrote:
With time and maturity I have come to the realisation that there is *always* an underlying machine and an underlying language
implementation ...
With popular languages, there are typically multiple implementations,
often built on very different implementation concepts.
This is the case with Python, just for example.--
On Wed, 24 Sep 2025 16:55:16 +0530, Madhu wrote:
* Lawrence DrCOOliveiro <10b0cks$3i6j6$1@dont-email.me> :
a, b = b, a
What does this ... have to do with bindings (either
destructuring or multiple values)?
Structuring on the RHS, destructuring on the LHS. All happens automatically, without you even having to think about it.
Maybe more obvious if you put in the optional parentheses, to make explicit that there is only a single expression on the RHS:--
(a, b) = (b, a)
Lisp does not have infix operators. ThatrCOs a basic design decision.
Ar an ceathr|| l|i is fiche de m|! M|-an F||mhair, scr|!obh Lawrence DrCOOliveiro:
With popular languages, there are typically multiple
implementations, often built on very different implementation
concepts.
And very few of them have no stack, or no heap, or are implemented
on drum-memory computers, or use an underlying integer
representation that is other than twosrCO complement.
automatically, without you even having to think about it.
Maybe more obvious if you put in the optional parentheses, to make
explicit that there is only a single expression on the RHS:
(a, b) = (b, a)