| Deutsch English Français Italiano |
|
<103gfb9$2l8ta$2@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Mark Summerfield <m.n.summerfield@gmail.com>
Newsgroups: comp.lang.tcl
Subject: Re: failing to understand/use lambda
Date: Wed, 25 Jun 2025 09:26:01 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <103gfb9$2l8ta$2@dont-email.me>
References: <103gakv$2l8ta$1@dont-email.me> <ygaikkk9otq.fsf@akutech.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 25 Jun 2025 11:26:01 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a51d7336ad3a7824209850b66bc6df62";
logging-data="2794410"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+8b85CO6+Xc84lBabRlhcD"
User-Agent: Pan/0.154 (Izium; 517acf4)
Cancel-Lock: sha1:naOYYJ5ZYoIk5xFtTLCqsubaBdI=
On Wed, 25 Jun 2025 11:02:09 +0200, Ralf Fassel wrote:
> * Mark Summerfield <m.n.summerfield@gmail.com>
> | oo::define Store method add {args} {
> | puts "action: adding [llength $args] new files"
> | $Reporter "adding [llength $args] new files"
> | }
> --<snip-snip>--
> | Actual output:
>>
> | action: adding 3 new files
> | invalid command name "::apply {message { puts "reporter: $message" }}"
>
> Note that I have no experience with lambda(n), but the error message
> sounds like you need
>
> {*}$Reporter "adding ..."
>
> when calling the reporter (i.e. expand the command being called).
>
> HTH
> R'
Fabulous! That's all it took. _And_ I now understand the error message;
Tcl was getting the entire string as the command, but using {*} broke
it down into its constituents.
PS I use the Pan newsreader and ever with wrap off it still messes up
my posts when it comes to code (e.g., seemingly randomly ignoring
newlines).