Slava Pestov wrote:
> There's a clean way to do this without locals. I discovered this idiom
> recently, it's not entirely obvious, so I thought I'd share it with
>
> the list:
> :: range-model-label ( text model -- gadget )
>
> [ <shelf> ] 2dip
> [ <label> add-gadget ]
> [ [ first round number>string ] <filter> <label-control> add-gadget ]
> bi* ;
The 'model-changed' method in the other paste also looks pretty good in pure
concatenative form:
M: <range-model-tie> model-changed ( model link -- )
tuck a>> =
[ [ a>> range-value ] [ quot>> call ] [ b>> ] tri set-range-value ]
[ [ b>> range-value ] [ quot>> undo ] [ a>> ] tri set-range-value ]
if ;
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk