Re: failing to understand/use lambda

Liste des GroupesRevenir à cl tcl 
Sujet : Re: failing to understand/use lambda
De : m.n.summerfield (at) *nospam* gmail.com (Mark Summerfield)
Groupes : comp.lang.tcl
Date : 25. Jun 2025, 10:26:01
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <103gfb9$2l8ta$2@dont-email.me>
References : 1 2
User-Agent : Pan/0.154 (Izium; 517acf4)
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).

Date Sujet#  Auteur
25 Jun 25 * failing to understand/use lambda4Mark Summerfield
25 Jun 25 `* Re: failing to understand/use lambda3Ralf Fassel
25 Jun 25  `* Re: failing to understand/use lambda2Mark Summerfield
25 Jun 25   `- Re: failing to understand/use lambda1Ralf Fassel

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal