Re: [Factor-talk] deep-cleave-quots

2008-11-23 Thread Slava Pestov
On Sun, Nov 23, 2008 at 2:19 AM, Eduardo Cavazos [EMAIL PROTECTED] wrote: :: [deep-cleave-quots] ( SEQ -- quot ) [let | QUOTS [ SEQ [ quotation? ] deep-filter ] RECIPE [ SEQ [ dup quotation? [ drop , ] [ ] if ] deep-map] | [ QUOTS cleave RECIPE bake ] ]

[Factor-talk] deep-cleave-quots

2008-11-23 Thread Jean-François Bigot
Hi, When I try to do something in Factor: 1. I look in libraries if a word do what I want (not always simple, and sometimes really hard) 2. I try to do it by myself if it is easy 3. I look at examples in extra vocabs and try to understand what is done (a great hand parsing job !) When I

Re: [Factor-talk] Four versions of PONG. Two in Factor. A locals tour de force. ; -)

2008-11-23 Thread janko metelko
hm, very interesting.. I would love to see how the idiomatic factor of this would look like. Too bad I don't have time to try to write it in that. Best regards, janko On Sun, Nov 23, 2008 at 12:13 AM, Eduardo Cavazos [EMAIL PROTECTED] wrote: I ran into an implementation of PONG written for

Re: [Factor-talk] deep-cleave-quots

2008-11-23 Thread Eduardo Cavazos
Slava Pestov wrote: Here is my version, lest the peanut gallery think that our only took for dealing with complexity is locals: MACRO: deep-cleave-quots ( seq -- quot ) [ [ quotation? ] deep-filter ] [ [ dup quotation? [ drop , ] when ] deep-map ] bi '[ _ cleave _ bake ] ;

Re: [Factor-talk] Four versions of PONG. Two in Factor. A locals tour de force. ; -)

2008-11-23 Thread Eduardo Cavazos
janko metelko wrote: I would love to see how the idiomatic factor of this would look like. I took the internal defines version to the extreme. The main body is now: ball-in-bounds? [ align-paddle-with-mouse move-ball

[Factor-talk] The trouble with an inverted Y axis: top, bottom, above, below

2008-11-23 Thread Eduardo Cavazos
Hello, In graphics code, I like to use words like 'top', 'bottom', 'above', 'below', etc for comparing the relative location of objects. Words like 'left', 'right', 'left-of', 'right-of', work fine because the default coordinate system in the ui has 'X' increasing to the right. But the

Re: [Factor-talk] deep-cleave-quots

2008-11-23 Thread Slava Pestov
On Sun, Nov 23, 2008 at 7:36 AM, Jean-François Bigot [EMAIL PROTECTED] wrote: is easy to cross for a newbie. Slava's solution is more readable for me, but the most difficult point is to discover that words like deep-map and deep-filter exist. Hi, The problem here is that many Factor libraries

[Factor-talk] Pull request: small improvements in Emacs factor-mode

2008-11-23 Thread Jose A. Ortega Ruiz
[Improvements on how font lock is handled. No new functionality, except for some key bindings in factor-help-mode] The following changes since commit 65b89eea9e479da3e202b36f87b324745462be43: Slava Pestov (1): Fix compile error are available in the git repository at: