[Factor-talk] ndrop

2015-01-28 Thread Alexander Iljin
Hi, all! I'm a newbie trying to understand Factor. Today I wrote a function called ndrop. The idea is that if you have nine pieces of junk on the stack you could write "9 ndrop" to get rid of them. Here's my attempted solution: USING: kernel math ; IN: ndrop ! Drop n items from the stack

Re: [Factor-talk] ndrop

2015-01-28 Thread Jon Harper
Hi Alexander, The input quotations to “while” don't match their expected effects > Input Expected Got > [ dup 0 > ] ( ..a -- ..b ? ) ( x -- x x ) > [ 1 - swap drop ] ( ..b -- ..a ) ( x x -- x ) > > Regarding the first line: > These two lines can not be interpreted sep

Re: [Factor-talk] ndrop

2015-01-28 Thread Alexander Iljin
Hello, Jon! Thank you, you've explained a lot! It's funny that I stumbled into this on my second day of experimentation. Turns out there's an important characteristic of the language, and thanks to you I'm now aware of it. Unfortunately, the documentation is too terse for me to understand

Re: [Factor-talk] ndrop

2015-01-28 Thread John Benediktsson
Feel free to ask more questions on the mailing list, or through a Github Issue if you'd like some help. On Wed, Jan 28, 2015 at 7:48 AM, Alexander Iljin wrote: > Hello, Jon! > > Thank you, you've explained a lot! > > It's funny that I stumbled into this on my second day of > experimentation.