(I searched the archives and couldn't see a discussion related to this. Apologies if it has been discussed) Paul Graham poses a problem with example solutions...
Chris Double
chris.double@...
Jun 2, 2004 11:14 pm
1848
Hi Chris, I'm not 100% sure if my solution in Joy meets all the requirements of the challanage but here it is: acc == [uncons [+ dup] dip dup [cons] dip cons]...
After digging a bit through the archives I found the post with Nick Forde's original solution in Joy: http://groups.yahoo.com/group/concatenative/message/1407 ...
... This works in Factor too. The only thing you have to change is the word ... [ uncons [ + dup ] dip dup [ cons ] dip cons ] dup [ cons ] dip cons ; In...
Slava Pestov
slava@...
Jun 3, 2004 8:46 pm
1851
... That does it, thanks! It works in Factor too. I missed the previous discussion on the list. I tried the search feature on yahoo groups and it failed to...
Chris Double
chris.double@...
Jun 3, 2004 10:17 pm
1852
On Thu, 03 Jun 2004 16:44:34 -0400, "Slava Pestov" <slava@...> ... Why is that? Or are functions that 'capture state' an example of the type of thing...
Chris Double
chris.double@...
Jun 3, 2004 10:35 pm
1853
I think a better solution to this would be to write a word tree-each ( tree code -- ) that is like 'each' but recursive. Then you could do, for example: [ . ]...
Slava Pestov
slava@...
Jun 3, 2004 11:18 pm
1854
On Thu, 03 Jun 2004 19:18:28 -0400, "Slava Pestov" <slava@...> ... over [ over cons? [ ... ] [ call ] ifte ] [ 2drop ] ifte ; [ 1 2 [ 3 4 ] 5 ] [ . ]...
Chris Double
chris.double@...
Jun 4, 2004 1:40 am
1855
Hi, Nicely done! The reason it doesn't compile is because it is a higher-order word. Only specific *instances* of higher order words compile. For example, the ...
Slava Pestov
slava@...
Jun 4, 2004 1:53 am
1856
On Thu, 03 Jun 2004 21:53:19 -0400, "Slava Pestov" <slava@...> ... Thanks! ... Sure, that'd be great. Chris. -- Chris Double chris.double@......
Chris Double
chris.double@...
Jun 4, 2004 4:04 am
1857
My apologies for this cross-post, but I just can't tell which of you will be interested in my latest effort: the Unix Power Classic, an evolving...
thanks to both of you for triggering some thoughts on this problem (that is, the "same fringe" problem.) i've posted those (and some code) at ...
stevan apter
sa@...
Jun 5, 2004 1:22 am
1859
I'm experimenting with writing generators and coroutines and thought I'd post the findings here in case others have questions. For a coroutine code I wanted to...
Chris Double
chris.double@...
Jun 7, 2004 6:58 am
1860
Here's some code to create a tree generator and generic code to iterate over generators: ! Given a tree and an escaping continuation, call that continuation...
Chris Double
chris.double@...
Jun 7, 2004 7:52 am
1861
The tree iteration example can be generalized further using the equivalent of Pythons yield: [ [ 1 2 [ 3 4 ] 5 ] [ yield ] tree-each ] make-generator ...
Chris Double
chris.double@...
Jun 7, 2004 8:41 am
1862
this is interesting, but hard to follow. it would be great if one of you could write up a tutorial on continuations and generators in factor (for dummies)....
stevan apter
sa@...
Jun 7, 2004 9:20 pm
1863
... Sure, I'll see what I can do. I'm completely new to Factor myself so don't know what makes good coding style or idiomatic usage though. Much of what can be...
Chris Double
chris.double@...
Jun 7, 2004 11:35 pm
1864
Hi all, I uploaded a new Factor release, 0.59 at www.jedit.org/factor/. Several years ago I wrote a simple symbolic algebra program with complex numbers and...
Slava Pestov
slava@...
Jun 8, 2004 6:14 am
1865
Chris, I think your generator library should be included with Factor; what do you think? Your code is nicely written. You're certainly making more use of...
Slava Pestov
slava@...
Jun 8, 2004 6:22 am
1866
Hi all, I'm currently working on a 'workspace' feature for improved startup speed and transparent persistence. In 0.59, it is now stable enough to try out...
Slava Pestov
slava@...
Jun 8, 2004 6:31 am
1867
... [...] ... That depends. There are several ways of implementing all the requisite "push-onto-the-program-stack". Let Q = [x y1 y2 ...yN z] be the program...
Hi everybody, I finally sat down and properly documented the Factor compiler. http://www.jedit.org/factor/compiler-use.txt ...
Slava Pestov
slava@...
Jun 10, 2004 10:06 pm
1869
Hi all, The classic definition of a stack has only two operations, push and pop. Under this definition, only the top item is available for use - the...
Hi, Permutations can be defined in terms of pop/push; for example, dup is just temp = pop(); push(temp); push(temp); swap is a = pop(); b = pop(); push(a); ...
Slava Pestov
slava@...
Jun 11, 2004 10:15 pm
1871
... In my experience stacks are generally understood to include all the operators you mention. The classic stack orientated language, forth, has them all and...
This is true, but it is not the way we implement or visualize the situation. In the same way, multiplication can be defined in terms of addition but having a...
Forth is not a "classic stack" oriented language. The classic stack as defined in any University class or book on data structures has only the two original...
... 1. Whether you define number theory with multiplication or not, in both cases you would call the underlying model the set of numbers. Adding new operations...
On Tue, 08 Jun 2004 02:21:02 -0400, "Slava Pestov" <slava@...> ... Sure, if you want to include it that's fine with me. Continuations combined with a...