[Factor-talk] default constructor

2007-02-14 Thread Eduardo Cavazos
Slava, It would be nice if the default BOA-style constructors for tuples are always available even if the user provides a custom constructor. For example: TUPLE: point x y z ; C: point ... ; So even though the user specified a custom constructor with special behaviour, the si

[Factor-talk] closures

2007-02-14 Thread Eduardo Cavazos
Hello, Below is an implementation of closures with parameters. Some examples are below. The example transcript was made with my listener mod. So after each line of input, you'll see the output which is laid out like this: <<>> -- <<>> -- <<>> !

Re: [Factor-talk] closures

2007-02-14 Thread Daniel Ehrenberg
Why the variables? All you really need for closures is curry, and possibly 2curry and 3curry. Here's your example { x } [ { y } [ x> y> + ] lambda ] lambda translated into that form: [ [ + ] curry ]. For an example of use: 1 [ [ + ] curry ] call => [ 1 + ]; 1 2 [ [ + ] curry ] call call => 3. It's

Re: [Factor-talk] listener mod

2007-02-14 Thread Slava Pestov
Hi, Instead of redefining the 'listen' word, you can store a quotation in the listener-hook variable. Also defining a word : foo-on foo on ; is totally redundant. It is not more readable and does not save keystrokes either. Slava On 13-Feb-07, at 7:32 PM, Eduardo Cavazos wrote: > Hello, >

[Factor-talk] stack-display on/off

2007-02-14 Thread Eduardo Cavazos
On Wednesday 14 February 2007 11:47, Slava Pestov wrote: > Also defining a word : foo-on foo on ; is totally redundant. It is > not more readable and does not save keystrokes either. Yeah, I prefer the just the variable and on/off. I have removed the redundant words. The reason they were there i

[Factor-talk] listener-hook

2007-02-14 Thread Eduardo Cavazos
On Wednesday 14 February 2007 11:47, Slava Pestov wrote: > Instead of redefining the 'listen' word, you can store a quotation in > the listener-hook variable. Yeah, I noticed the listener-hook variable and I'd prefer to add things to a hook. However... : listener ( -- ) quit-flag get [ quit-fl

[Factor-talk] help for rethrow

2007-02-14 Thread Eduardo Cavazos
Slava, The help for rethrow has an example but it seems to demonstrate catch instead of rethrow. Did you mean for that example to go in the help for catch? Ed - Take Surveys. Earn Cash. Influence the Future of IT Join Sourc