Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Let me put it this way: today is going to be a learning experience.


comp / comp.lang.tcl / Re: request new command "lstride"

SubjectAuthor
* request new command "lstride"aotto1968
+* Re: request new command "lstride"aotto1968
|`* Re: request new command "lstride"Christian Gollwitzer
| `* Re: request new command "lstride"aotto1968
|  `* Re: request new command "lstride"Christian Gollwitzer
|   `- Re: request new command "lstride"aotto1968
`* Re: request new command "lstride"Andreas Leitgeb
 `* Re: request new command "lstride"Christian Gollwitzer
  `- Re: request new command "lstride"Andreas Leitgeb

1
Subject: request new command "lstride"
From: aotto1968
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Fri, 17 May 2024 06:22 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: aotto1968@t-online.de (aotto1968)
Newsgroups: comp.lang.tcl
Subject: request new command "lstride"
Date: Fri, 17 May 2024 08:22:45 +0200
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <v26t3m$2298u$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 17 May 2024 08:22:47 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c2f923267b8ae90e153d4b11a1fea2d6";
logging-data="2172190"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18sUzU8LL+T63uxpWht6U0lQtkGOPVffRE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:yU3+Lq9mj9X0EES1P9XMDSLo8iA=
Content-Language: en-US
View all headers

request new command lstride (ref: https://wiki.tcl-lang.org/page/request+new+command+lstride)

The following code is used:

proc lib_ME__copy_what {whatRef old new} {
upvar $whatRef whatDEF
global attributeDEF ARG_TYPE_ATTRIBUTE RET_TYPE_ATTRIBUTE ARG_DEFAULT

set mapL [list $old $new]

array set attributeDEF \
[concat {*}[lmap {k v} [array get attributeDEF $old,*] {list [string map $mapL $k] $v} ]]
array set ARG_TYPE_ATTRIBUTE \
[concat {*}[lmap {k v} [array get ARG_TYPE_ATTRIBUTE $old,*] {list [string map $mapL $k] $v} ]]
array set RET_TYPE_ATTRIBUTE \
[concat {*}[lmap {k v} [array get RET_TYPE_ATTRIBUTE $old,*] {list [string map $mapL $k] $v} ]]
array set ARG_DEFAULT \
[concat {*}[lmap {k v} [array get ARG_DEFAULT $old,*] {list [string map $mapL $k] $v} ]]
set whatDEF($new) $whatDEF($old)
}

the syntax I recommend is

proc lib_ME__copy_what {whatRef old new} {
upvar $whatRef whatDEF
global attributeDEF ARG_TYPE_ATTRIBUTE RET_TYPE_ATTRIBUTE ARG_DEFAULT

set mapL [list $old $new]

array set attributeDEF [lmap {k v} [array get attributeDEF $old,*] {lstride [string map $mapL $k] $v} ]
array set ARG_TYPE_ATTRIBUTE [lmap {k v} [array get ARG_TYPE_ATTRIBUTE $old,*] {lstride [string map $mapL $k] $v} ]
array set RET_TYPE_ATTRIBUTE [lmap {k v} [array get RET_TYPE_ATTRIBUTE $old,*] {lstride [string map $mapL $k] $v} ]
array set ARG_DEFAULT [lmap {k v} [array get ARG_DEFAULT $old,*] {lstride [string map $mapL $k] $v} ]
set whatDEF($new) $whatDEF($old)
}

The new command lstride has the same effect as {*} this mean create a flat list

Subject: Re: request new command "lstride"
From: aotto1968
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Fri, 17 May 2024 09:52 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: aotto1968@t-online.de (aotto1968)
Newsgroups: comp.lang.tcl
Subject: Re: request new command "lstride"
Date: Fri, 17 May 2024 11:52:58 +0200
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <v279dq$24m15$1@dont-email.me>
References: <v26t3m$2298u$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 17 May 2024 11:52:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c2f923267b8ae90e153d4b11a1fea2d6";
logging-data="2250789"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193FG7waOp3T1/m2IWs+4OsJ+alf1/Zq94="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:HxCnHLPNPxmLId1GbGTO7MU0uKU=
Content-Language: en-US
In-Reply-To: <v26t3m$2298u$1@dont-email.me>
View all headers

more easy example


lappend a {*}[list 1 2 3]
=> 1 2 3

lappend b [lstride 1 2 3]
=> 1 2 3

lappend c [list 1 2 3]
=> {1 2 3}

On 17.05.24 08:22, aotto1968 wrote:
> request new command lstride (ref: https://wiki.tcl-lang.org/page/request+new+command+lstride)
>
>
> The following code is used:
>
> proc lib_ME__copy_what {whatRef old new} {
>   upvar $whatRef whatDEF
>   global attributeDEF ARG_TYPE_ATTRIBUTE RET_TYPE_ATTRIBUTE ARG_DEFAULT
>
>   set mapL  [list $old $new]
>
>   array set attributeDEF \
>     [concat {*}[lmap {k v} [array get attributeDEF $old,*]        {list [string map $mapL $k] $v} ]]
>   array set ARG_TYPE_ATTRIBUTE \
>     [concat {*}[lmap {k v} [array get ARG_TYPE_ATTRIBUTE $old,*]  {list [string map $mapL $k] $v} ]]
>   array set RET_TYPE_ATTRIBUTE \
>     [concat {*}[lmap {k v} [array get RET_TYPE_ATTRIBUTE $old,*]  {list [string map $mapL $k] $v} ]]
>   array set ARG_DEFAULT \
>     [concat {*}[lmap {k v} [array get ARG_DEFAULT $old,*]         {list [string map $mapL $k] $v} ]]
>   set whatDEF($new) $whatDEF($old)
> }
>
> the syntax I recommend is
>
> proc lib_ME__copy_what {whatRef old new} {
>   upvar $whatRef whatDEF
>   global attributeDEF ARG_TYPE_ATTRIBUTE RET_TYPE_ATTRIBUTE ARG_DEFAULT
>
>   set mapL  [list $old $new]
>
>   array set attributeDEF       [lmap {k v} [array get attributeDEF $old,*]        {lstride [string map $mapL $k] $v} ]
>   array set ARG_TYPE_ATTRIBUTE [lmap {k v} [array get ARG_TYPE_ATTRIBUTE $old,*]  {lstride [string map $mapL $k] $v} ]
>   array set RET_TYPE_ATTRIBUTE [lmap {k v} [array get RET_TYPE_ATTRIBUTE $old,*]  {lstride [string map $mapL $k] $v} ]
>   array set ARG_DEFAULT        [lmap {k v} [array get ARG_DEFAULT $old,*]         {lstride [string map $mapL $k] $v} ]
>   set whatDEF($new) $whatDEF($old)
> }
>
> The new command lstride has the same effect as {*} this mean create a flat list

Subject: Re: request new command "lstride"
From: Christian Gollwitzer
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Fri, 17 May 2024 17:14 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: auriocus@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.tcl
Subject: Re: request new command "lstride"
Date: Fri, 17 May 2024 19:14:09 +0200
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <v28391$29p5q$1@dont-email.me>
References: <v26t3m$2298u$1@dont-email.me> <v279dq$24m15$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 17 May 2024 19:14:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="eeae76580917837eba2dcb19b0ec6294";
logging-data="2417850"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tBwc/UUpuJNzR9hoka2c8ArV887WxdGE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:pCDpwdKJwzxqpC7DpBUxWhZpabc=
In-Reply-To: <v279dq$24m15$1@dont-email.me>
View all headers

Am 17.05.24 um 11:52 schrieb aotto1968:
>
> more easy example
>
> 
> lappend a {*}[list 1 2 3]
> => 1 2 3
>
OK

> lappend b [lstride 1 2 3]
> => 1 2 3

impossible. This would violate the basic rules of Tcl

Christian

Subject: Re: request new command "lstride"
From: aotto1968
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 18 May 2024 06:21 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: aotto1968@t-online.de (aotto1968)
Newsgroups: comp.lang.tcl
Subject: Re: request new command "lstride"
Date: Sat, 18 May 2024 08:21:05 +0200
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <v29hcj$2lk6h$1@dont-email.me>
References: <v26t3m$2298u$1@dont-email.me> <v279dq$24m15$1@dont-email.me>
<v28391$29p5q$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 18 May 2024 08:21:07 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="31991dab1e2bba24655fe395914e4722";
logging-data="2805969"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/VRUiGCzvCOAXGxtV++eTATit3vyHn98="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:xBrB1+ltxeGiPFxBbGbnlXUv+kU=
In-Reply-To: <v28391$29p5q$1@dont-email.me>
Content-Language: en-US
View all headers

On 17.05.24 19:14, Christian Gollwitzer wrote:
> Am 17.05.24 um 11:52 schrieb aotto1968:
>>
>> more easy example
>>
>> 
>> lappend a {*}[list 1 2 3]
>> => 1 2 3
>>
> OK
>
>> lappend b [lstride 1 2 3]
>> => 1 2 3
>
> impossible. This would violate the basic rules of Tcl
>
>
>     Christian

I don't understand the problem of tcl the "Tcl_Obj" just need an *flat-flag* and
if you build the argument-list of a function-call you check this flag.

I don't even require that the *flat-flag* is persistent (convert to string and back)

mfg.

Subject: Re: request new command "lstride"
From: Christian Gollwitzer
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 18 May 2024 07:12 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: auriocus@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.tcl
Subject: Re: request new command "lstride"
Date: Sat, 18 May 2024 09:12:24 +0200
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <v29kco$2lvt5$1@dont-email.me>
References: <v26t3m$2298u$1@dont-email.me> <v279dq$24m15$1@dont-email.me>
<v28391$29p5q$1@dont-email.me> <v29hcj$2lk6h$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 18 May 2024 09:12:24 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="20ab083a64a8beb453f2895cb63ec6e0";
logging-data="2817957"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RMaCMQb7LcFLOumpGoHVtv2zPMEFHWl8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:vE04WtBqeW7KABHNSWCnv273jJo=
In-Reply-To: <v29hcj$2lk6h$1@dont-email.me>
View all headers

Am 18.05.24 um 08:21 schrieb aotto1968:
> On 17.05.24 19:14, Christian Gollwitzer wrote:
>> Am 17.05.24 um 11:52 schrieb aotto1968:
>>>
>>> more easy example
>>>
>>> 
>>> lappend a {*}[list 1 2 3]
>>> => 1 2 3
>>>
>> OK
>>
>>> lappend b [lstride 1 2 3]
>>> => 1 2 3
>>
>> impossible. This would violate the basic rules of Tcl
>>
>
> I don't understand the problem of tcl the "Tcl_Obj" just need an
> *flat-flag* and
> if you build the argument-list of a function-call you check this flag.

The rule is, if you can't write a proc lstride {args} that does what you
want, you're working against the basic rules as spelled out here:
https://www.tcl-lang.org/man/tcl/TclCmd/Tcl.htm
Rule 5 ({*}) has been added for Tcl 8.6 to cover the use case you described.

> I don't even require that the *flat-flag* is persistent (convert to
> string and back)

That would violate another one of the basic rules of Tcl - EIAS. You are
of course free to fork Tcl and create your own language that works
differently - go ahead and have fun, the license is very permissive.
However, don't be surprised that others will not adopt such fundamental
changes into mainline Tcl.

Christian

Subject: Re: request new command "lstride"
From: aotto1968
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 18 May 2024 12:07 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: aotto1968@t-online.de (aotto1968)
Newsgroups: comp.lang.tcl
Subject: Re: request new command "lstride"
Date: Sat, 18 May 2024 14:07:56 +0200
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <v2a5mu$2p8sc$1@dont-email.me>
References: <v26t3m$2298u$1@dont-email.me> <v279dq$24m15$1@dont-email.me>
<v28391$29p5q$1@dont-email.me> <v29hcj$2lk6h$1@dont-email.me>
<v29kco$2lvt5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 18 May 2024 14:07:58 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="31991dab1e2bba24655fe395914e4722";
logging-data="2925452"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qQcNz7nre2wRl+CyLNbIPX2uqt/J6VpE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:sCRvqaehWEofG/nNym79KBaDZww=
Content-Language: en-US
In-Reply-To: <v29kco$2lvt5$1@dont-email.me>
View all headers

#funny

#!/usr/bin/env tclsh

proc myproc {} {
string cat "{*}" [list 1 2 3]
}

lappend a [myproc]

puts $a

=> {{*}1 2 3}

the "secret" is just that TCL does NOT look into the value of the argument to decide how to process

→ the "{*}" prefix would be also fulfill the last "basic" rule

mfg

Subject: Re: request new command "lstride"
From: Andreas Leitgeb
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 18 May 2024 14:04 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: request new command "lstride"
Date: Sat, 18 May 2024 14:04:08 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <slrnv4hdao.2r7dk.avl@logic.at>
References: <v26t3m$2298u$1@dont-email.me>
Reply-To: avl@logic.at
Injection-Date: Sat, 18 May 2024 16:04:08 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e54d3e2c09eb3897ddcff4953abe85ea";
logging-data="2967246"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++FaoOXLxKA0fAsvn+xE8f"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:e3+o0AnjIoLk9b7ozknq9qtp8Po=
View all headers

aotto1968 <aotto1968@t-online.de> wrote:
> request new command lstride (ref: https://wiki.tcl-lang.org/page/request+new+command+lstride)
current:
> array set attributeDEF \
> [concat {*}[lmap {k v} [array get attributeDEF $old,*] {list [string map $mapL $k] $v} ]]
suggestion:
> array set attributeDEF [lmap {k v} [array get attributeDEF $old,*] {lstride [string map $mapL $k] $v} ]

Ignoring the further thread as it went straightforward against the
spirit of Tcl, there would still be a different (and tcl-conform)
way to achieve that:

The focus would need to go to lmap: it could interpret a specific
return-code (aside from "break" and "continue") - lets take 42 just
for now - and handle it such, that the value returned from
the lmap body is treated as a list and concated to the accumulator.

It would be possible to implement "lmap" as a tcl-procedure based
on foreach, uplevel, try&catch and lappend. Then a procedure "lstride"
could also be written: proc lstride {args} {return -code 42 $args}
and lmap would have a handler for code 42 to do "lappend acc {*}$value"
rather than the normal "lappend acc $value".

Now for a little twist: command "continue" cannot currently "return" a
non-empty value, it always returns an empty string or empty list.
So, we could interpret it already as a list of objects to add
individually to the accumulator - it would effectively be the same
as lmaps current response to a call of "continue" from the lmap-body.

In the end, by defining lstride such:
proc lstride {args} {return -code continue $args}
and having lmap handle "continue" to lappend'ing all elements
of the body's return value individually to its accumulator,
we would exactly have the requested behaviour fo lstride wrt. lmap.

PS: that's just brainstorming... I'm aware that changing "continue"
handling is not to be taken that lightly... - although the number
of people already having procedures to "continue with value" and
calling that from an lmap-body, relying on the value to be ignored,
might be diminishingly small.
I just found it cute, that current "continue"-handling would be just
a special case of that presented change.

Subject: Re: request new command "lstride"
From: Christian Gollwitzer
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 18 May 2024 15:14 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: auriocus@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.tcl
Subject: Re: request new command "lstride"
Date: Sat, 18 May 2024 17:14:23 +0200
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <v2agkf$2r5uh$1@dont-email.me>
References: <v26t3m$2298u$1@dont-email.me> <slrnv4hdao.2r7dk.avl@logic.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 18 May 2024 17:14:23 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="20ab083a64a8beb453f2895cb63ec6e0";
logging-data="2987985"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fVGFkKcAyv6yiiWLZ5wi//ezefji+1kg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:PeUgbGumo5Njn7w/Ck9EPhGcDMk=
In-Reply-To: <slrnv4hdao.2r7dk.avl@logic.at>
View all headers

Am 18.05.24 um 16:04 schrieb Andreas Leitgeb:
> aotto1968 <aotto1968@t-online.de> wrote:
>> request new command lstride (ref: https://wiki.tcl-lang.org/page/request+new+command+lstride)
> current:
>> array set attributeDEF \
>> [concat {*}[lmap {k v} [array get attributeDEF $old,*] {list [string map $mapL $k] $v} ]]
> suggestion:
>> array set attributeDEF [lmap {k v} [array get attributeDEF $old,*] {lstride [string map $mapL $k] $v} ]
>
> Ignoring the further thread as it went straightforward against the
> spirit of Tcl, there would still be a different (and tcl-conform)
> way to achieve that:
>
> The focus would need to go to lmap: it could interpret a specific
> return-code (aside from "break" and "continue") - lets take 42 just
> for now - and handle it such, that the value returned from
> the lmap body is treated as a list and concated to the accumulator.

I agree that changing lmap would be the way to go forward here -
however, the whole lstride thing seems overcomplicated to me. How about
an additional option for lmap, say, "-flat" or "-join" that makes lmap
concat the results instead of lappending? If one wishes to switch inside
the loop, one could easily wrap arguments into [list] :

>
> lmap -join {k v} [array get attributeDEF $old,*] {list [string map $mapL $k] $v} ]]

Christian

Subject: Re: request new command "lstride"
From: Andreas Leitgeb
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 18 May 2024 15:53 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: request new command "lstride"
Date: Sat, 18 May 2024 15:53:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <slrnv4hjnf.2r7dk.avl@logic.at>
References: <v26t3m$2298u$1@dont-email.me> <slrnv4hdao.2r7dk.avl@logic.at>
<v2agkf$2r5uh$1@dont-email.me>
Reply-To: avl@logic.at
Injection-Date: Sat, 18 May 2024 17:53:19 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e54d3e2c09eb3897ddcff4953abe85ea";
logging-data="3006991"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nrnY9B1rQ5h9S5HW9/K23"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:AtTFNl94pXCLzOR0FtlEVNaG5dY=
View all headers

Christian Gollwitzer <auriocus@gmx.de> wrote:
> Am 18.05.24 um 16:04 schrieb Andreas Leitgeb:
>> aotto1968 <aotto1968@t-online.de> wrote:
>>> request new command lstride (ref: https://wiki.tcl-lang.org/page/request+new+command+lstride)
>> current:
>>> array set attributeDEF \
>>> [concat {*}[lmap {k v} [array get attributeDEF $old,*] {list [string map $mapL $k] $v} ]]
>> suggestion:
>>> array set attributeDEF [lmap {k v} [array get attributeDEF $old,*] {lstride [string map $mapL $k] $v} ]
>> The focus would need to go to lmap: it could interpret a specific
>> return-code (aside from "break" and "continue") - lets take 42 just
>> for now - and handle it such, that the value returned from
>> the lmap body is treated as a list and concated to the accumulator.
> I agree that changing lmap would be the way to go forward here -
> however, the whole lstride thing seems overcomplicated to me. How about
> an additional option for lmap, say, "-flat" or "-join" that makes lmap
> concat the results instead of lappending?

Indeed, that would be ways simpler in the end, and it would save us from
a command that only ever makes sense within an lmap body. ;-)

Also, lmap currently cannot accept an even number of arguments, so it would
be safely distinct from a call with a single iterator variable named "-flat".

Only downside: each lmap invocation can only ever accept a single option.
Once there is "-flat" [btw. imho "-join" would be misleading] then
no further options can be added later (at least none that could ever be
combined with -flat).

>> lmap -join {k v} [array get attributeDEF $old,*] {list [string map $mapL $k] $v} ]]
> Christian

1

rocksolid light 0.9.8
clearnet tor