Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You will attract cultured and artistic people to your home.


comp / comp.lang.tcl / Re: lsearch proposed option

SubjectAuthor
* lsearch proposed optionRich
`* Re: lsearch proposed optionEmiliano
 `- Re: lsearch proposed optionaotto1968

1
Subject: lsearch proposed option
From: Rich
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Thu, 2 Jan 2025 21:39 UTC
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: lsearch proposed option
Date: Thu, 2 Jan 2025 21:39:32 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <vl712k$3h5v2$1@dont-email.me>
Injection-Date: Thu, 02 Jan 2025 22:39:33 +0100 (CET)
Injection-Info: dont-email.me; posting-host="6420596632e4571cd84179c8b721a5c9";
logging-data="3708898"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/VBmKhAgghDNmcy3eWYWaC"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Cancel-Lock: sha1:Oku50QfkW47vgrW8gbbQzehTbOE=
View all headers

aotto1968 <aotto1968@t-online.de> wrote:

It is preferable to start a new thread for a new topic.

> other stuff
>
> # OLD
>
> proc ::myoo::ClassIs {myR cls} {
> upvar $myR my
> expr {[llength [lsearch -exact -sorted [set $my(__CLASS__)::__SUPER__SORTED__] $cls]] > 0}
> }
>
> # want to have
>
> proc ::myoo::ClassIs {myR cls} {
> upvar $myR my
> lsearch -exists -exact -sorted [set $my(__CLASS__)::__SUPER__SORTED__] $cls
> }
>
> ONE simple FLAG erase a lot of code.
>

Write up a TIP, and supply an implementation, and the maintainers just
might add your feature.

Subject: Re: lsearch proposed option
From: Emiliano
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Thu, 2 Jan 2025 23:28 UTC
References: 1
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: emiliano@example.invalid (Emiliano)
Newsgroups: comp.lang.tcl
Subject: Re: lsearch proposed option
Date: Thu, 2 Jan 2025 20:28:54 -0300
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <20250102202854.b9d16596b2f78f5f4cff2823@example.invalid>
References: <vl712k$3h5v2$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 03 Jan 2025 00:29:04 +0100 (CET)
Injection-Info: dont-email.me; posting-host="5ee07b96d6ad73c243fa74a16a2ba82a";
logging-data="3743448"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193/FvvASFDK/WGH2hLkp/G2o1niXmrUpY="
Cancel-Lock: sha1:2dmL04dgf61C1xUXeepGe1CppTM=
X-Newsreader: Sylpheed 3.5.1 (GTK+ 2.24.32; i686-pc-linux-gnu)
View all headers

On Thu, 2 Jan 2025 21:39:32 -0000 (UTC)
Rich <rich@example.invalid> wrote:

> aotto1968 <aotto1968@t-online.de> wrote:
>
> It is preferable to start a new thread for a new topic.
>
> > other stuff
> >
> > # OLD
> >
> > proc ::myoo::ClassIs {myR cls} {
> > upvar $myR my
> > expr {[llength [lsearch -exact -sorted [set $my(__CLASS__)::__SUPER__SORTED__] $cls]] > 0}
> > }
> >
> > # want to have
> >
> > proc ::myoo::ClassIs {myR cls} {
> > upvar $myR my
> > lsearch -exists -exact -sorted [set $my(__CLASS__)::__SUPER__SORTED__] $cls
> > }
> >
> > ONE simple FLAG erase a lot of code.
> >
>
> Write up a TIP, and supply an implementation, and the maintainers just
> might add your feature.
>

Or simply use

proc ::myoo::ClassIs {myR cls} {
upvar $myR my
expr {$cls in [set $my(__CLASS__)::__SUPER__SORTED__]}
}

--
Emiliano

Subject: Re: lsearch proposed option
From: aotto1968
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Fri, 3 Jan 2025 07:15 UTC
References: 1 2
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: aotto1968@t-online.de (aotto1968)
Newsgroups: comp.lang.tcl
Subject: Re: lsearch proposed option
Date: Fri, 3 Jan 2025 08:15:13 +0100
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <vl82q1$3q3s9$1@dont-email.me>
References: <vl712k$3h5v2$1@dont-email.me>
<20250102202854.b9d16596b2f78f5f4cff2823@example.invalid>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 03 Jan 2025 08:15:15 +0100 (CET)
Injection-Info: dont-email.me; posting-host="bfcf6e41a8af79f2f3416b784180c3ca";
logging-data="4001673"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18lzh39vJ3sq0vn5lEzIS5s8to/a5Gvl8Q="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Q6uHCsBi72gbx7SPjKfrTxL2+Oc=
In-Reply-To: <20250102202854.b9d16596b2f78f5f4cff2823@example.invalid>
Content-Language: en-US
View all headers

On 03.01.25 00:28, Emiliano wrote:
> On Thu, 2 Jan 2025 21:39:32 -0000 (UTC)
> Rich <rich@example.invalid> wrote:
>
>> aotto1968 <aotto1968@t-online.de> wrote:
>>
>> It is preferable to start a new thread for a new topic.
>>
>>> other stuff
>>>
>>> # OLD
>>>
>>> proc ::myoo::ClassIs {myR cls} {
>>> upvar $myR my
>>> expr {[llength [lsearch -exact -sorted [set $my(__CLASS__)::__SUPER__SORTED__] $cls]] > 0}
>>> }
>>>
>>> # want to have
>>>
>>> proc ::myoo::ClassIs {myR cls} {
>>> upvar $myR my
>>> lsearch -exists -exact -sorted [set $my(__CLASS__)::__SUPER__SORTED__] $cls
>>> }
>>>
>>> ONE simple FLAG erase a lot of code.
>>>
>>
>> Write up a TIP, and supply an implementation, and the maintainers just
>> might add your feature.
>>
>
> Or simply use
>
> proc ::myoo::ClassIs {myR cls} {
> upvar $myR my
> expr {$cls in [set $my(__CLASS__)::__SUPER__SORTED__]}
> }
>
you just missing the "-sorted".

1

rocksolid light 0.9.8
clearnet tor