Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Staff meeting in the conference room in 3 minutes.


devel / comp.lang.tcl / Re: uplevel and {*}$args -- variable number of args.

SubjectAuthor
* uplevel and {*}$args -- variable number of args.Robert Heller
+- Re: uplevel and {*}$args -- variable number of args.briang
`* Re: uplevel and {*}$args -- variable number of args.Mole Cool
 `- Re: uplevel and {*}$args -- variable number of args.luocl

1
uplevel and {*}$args -- variable number of args.

<Xu2dncUNAZrOxQP_nZ2dnUU7-X3NnZ2d@giganews.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19486&group=comp.lang.tcl#19486

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 06 Jun 2022 14:41:07 -0500
MIME-Version: 1.0
From: heller@deepsoft.com (Robert Heller)
Organization: Deepwoods Software
X-Newsreader: TkNews 3.0 (1.2.12)
Subject: uplevel and {*}$args -- variable number of args.
Newsgroups: comp.lang.tcl
Content-Type: text/plain;
charset="us-ascii"
Originator: heller@sharky4.deepsoft.com
Message-ID: <Xu2dncUNAZrOxQP_nZ2dnUU7-X3NnZ2d@giganews.com>
Date: Mon, 06 Jun 2022 14:41:07 -0500
Lines: 36
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-BNe9L3JzzeVksgiUPZr2rBEVPn6n83gcf1xu3pj7c+5QYRoZgVtYslw0aCV1PrY3goxbWTekSSUPTrR!Fwy+dY4F5CftP8nOOpBpwCo82vhEYK2GHILF+zCbLiSfYH2YMGXHSGOXwkCyQiQpmdzQoVoiPtHV!ZxA=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2360
 by: Robert Heller - Mon, 6 Jun 2022 19:41 UTC

I am strugling with argument lists that contain lists and what happens with
uplevel and {*}$args. The lists are getting flattened. How can I preserve
the sub-lists? There has got to be way of doing this, but I am failing to
manage it.

uplevel #0 $options(-callback) PLANETARY_ORBIT [from arglist -epoch] \
"[from arglist -position]" "[from arglist -velocity]"

Then in the callback proc:

method _clientCallback {cmd epoch args} {
switch $cmd {
...
PLANETARY_ORBIT {
$self setposval {*}$args
}
...
}
}

method setposval {pos vel} {
...
}
The -position and -velocity options in the original arglist are lists of three
numbers, that eventually end up at pos and vel in setposval, but setposval is
getting 6 arguments instead. Somewhere between uplevel, the args argument to
_clientCallback and the use of {*}$args (and yes, this is all happening inside
of SNIT types). Oh, I am using Tcl 8.6.11

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
heller@deepsoft.com -- Webhosting Services

Re: uplevel and {*}$args -- variable number of args.

<9838224b-f853-4d64-af5b-4aca27f40da5n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19491&group=comp.lang.tcl#19491

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ad4:4bcb:0:b0:464:692c:6985 with SMTP id l11-20020ad44bcb000000b00464692c6985mr19207563qvw.48.1654558747340;
Mon, 06 Jun 2022 16:39:07 -0700 (PDT)
X-Received: by 2002:a9d:20e9:0:b0:60b:f60b:a7de with SMTP id
x96-20020a9d20e9000000b0060bf60ba7demr4489796ota.142.1654558747052; Mon, 06
Jun 2022 16:39:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Mon, 6 Jun 2022 16:39:06 -0700 (PDT)
In-Reply-To: <Xu2dncUNAZrOxQP_nZ2dnUU7-X3NnZ2d@giganews.com>
Injection-Info: google-groups.googlegroups.com; posting-host=50.53.75.154; posting-account=f4QznQoAAAAjupLEpV87s_G-96g1Io1w
NNTP-Posting-Host: 50.53.75.154
References: <Xu2dncUNAZrOxQP_nZ2dnUU7-X3NnZ2d@giganews.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9838224b-f853-4d64-af5b-4aca27f40da5n@googlegroups.com>
Subject: Re: uplevel and {*}$args -- variable number of args.
From: bgriffinfortytwo@gmail.com (briang)
Injection-Date: Mon, 06 Jun 2022 23:39:07 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1750
 by: briang - Mon, 6 Jun 2022 23:39 UTC

On Monday, June 6, 2022 at 12:41:17 PM UTC-7, Robert Heller wrote:
> I am strugling with argument lists that contain lists and what happens with
> uplevel and {*}$args. The lists are getting flattened.

Just remember that [uplevel] is another form of [eval]. With these commands, the argument list is processed twice, once by the execution of [eval] and again when [eval] executes the requested command. This means that arguments that require proper quoting need to be quoted twice. This is, in essence, what happens with Dave's posted solution.

-Brian

Re: uplevel and {*}$args -- variable number of args.

<8c485998-1d6a-4ff4-b945-56fd518f72dan@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19494&group=comp.lang.tcl#19494

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:5e0f:0:b0:2fc:60f5:dd87 with SMTP id h15-20020ac85e0f000000b002fc60f5dd87mr21729053qtx.537.1654592136538;
Tue, 07 Jun 2022 01:55:36 -0700 (PDT)
X-Received: by 2002:a05:6830:2396:b0:60c:dc9:6bad with SMTP id
l22-20020a056830239600b0060c0dc96badmr316133ots.244.1654592136352; Tue, 07
Jun 2022 01:55:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Tue, 7 Jun 2022 01:55:36 -0700 (PDT)
In-Reply-To: <Xu2dncUNAZrOxQP_nZ2dnUU7-X3NnZ2d@giganews.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:ee:9733:2d00:61c0:62b4:e4c7:53cc;
posting-account=IpC1pwoAAACCAmF-qbg4PWxvUAd-j7Tc
NNTP-Posting-Host: 2003:ee:9733:2d00:61c0:62b4:e4c7:53cc
References: <Xu2dncUNAZrOxQP_nZ2dnUU7-X3NnZ2d@giganews.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8c485998-1d6a-4ff4-b945-56fd518f72dan@googlegroups.com>
Subject: Re: uplevel and {*}$args -- variable number of args.
From: molecool1058@googlemail.com (Mole Cool)
Injection-Date: Tue, 07 Jun 2022 08:55:36 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mole Cool - Tue, 7 Jun 2022 08:55 UTC

Just use eval, if you start quoting it may get ugly :-)

uplevel #0 $options(-callback) PLANETARY_ORBIT [from arglist -epoch] \
[list [from arglist -position] ] [list [from arglist -velocity]]

Then in the callback proc:

method _clientCallback {cmd epoch args} {
switch $cmd {
....
PLANETARY_ORBIT {
eval $self setposval $args
}
....
}
}

method setposval {pos vel} {
...
}

Re: uplevel and {*}$args -- variable number of args.

<t7n708$se2$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19495&group=comp.lang.tcl#19495

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!pqr40x/WgomdPT3dx9wwPw.user.46.165.242.75.POSTED!not-for-mail
From: vimperatorluo@qq.com (luocl)
Newsgroups: comp.lang.tcl
Subject: Re: uplevel and {*}$args -- variable number of args.
Date: Tue, 7 Jun 2022 17:49:58 +0800
Organization: Aioe.org NNTP Server
Message-ID: <t7n708$se2$1@gioia.aioe.org>
References: <Xu2dncUNAZrOxQP_nZ2dnUU7-X3NnZ2d@giganews.com>
<8c485998-1d6a-4ff4-b945-56fd518f72dan@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="29122"; posting-host="pqr40x/WgomdPT3dx9wwPw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.12.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: luocl - Tue, 7 Jun 2022 09:49 UTC

On 6/7/22 4:55 PM, Mole Cool wrote:
> Just use eval, if you start quoting it may get ugly :-)
>
> uplevel #0 $options(-callback) PLANETARY_ORBIT [from arglist -epoch] \
> [list [from arglist -position] ] [list [from arglist -velocity]]
or this style

uplevel #0 [list $options(-callback) PLANETARY_ORBIT \
[from arglist -epoch] [from arglist -position] [from arglist -velocity]]

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor