Re: [TCLCORE] TIP 672 contribution $(expressions)

0 views
Skip to first unread message

Eric

unread,
Jun 7, 2023, 11:08:00 PM6/7/23
to tcl-...@lists.sourceforge.net
In TIP 672 I see now how the examples section could be confusing.

I was so much concentrating on the one incompatibility, and how to fix it
that I forgot to add any actual examples of the new usage in that section.

The only other examples listed are at the very top in the discussion.

Here are a couple of example uses:

#add tags using 4 expressions and the point x,y
.canvas addtag all enclosed $($x - 20) $($x + 20) $($y - 20) $($y + 20)

% lassign {3.0 4.0} a b
% set c $( sqrt($a**2 + $b**2) ) ;# 3 4 5 triangle
5.0

% set total 1000
1000
% set number 3
3
% puts "ave = $( double($total)/$number )" ;# demo usage inside quotes
ave = 333.333333333

Otherwise, I think just knowing it's really just a shorthand for [expr]
should be sufficient.

-Eric



_______________________________________________
Tcl-Core mailing list
Tcl-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcl-core
Reply all
Reply to author
Forward
0 new messages