On 13-Jan-07, at 1:09 PM, Daniel Ehrenberg wrote:
> Well, I didn't write the definitions in the interpreter; I loaded them
> with load-module, but either way, you're right: the problem was that
> things weren't compiled. Do you think it's possible for generic words
> to automatically be decompile
Alex, Except for the constructor and last word, our two datastructures
are very similar. Mind if I take your implementation and split it off
into a separate library, adding a couple of utility functions that I
need?
Dan
On 1/13/07, Alex Chapman <[EMAIL PROTECTED]> wrote:
> I implemented something
Well, I didn't write the definitions in the interpreter; I loaded them
with load-module, but either way, you're right: the problem was that
things weren't compiled. Do you think it's possible for generic words
to automatically be decompiled when an issue like this comes up?
On 1/13/07, Slava Pesto
Just to clarify what is going on:
On 13-Jan-07, at 1:14 AM, Chris Double wrote:
> An easy way to show the problem is:
You pasted the definitions in the listener.
>
> ! this works
> 1 T{ circle f "abc" 0 } nth .
Here, you're executing the interpreted definition of 'nth' (you just
redefined nth
Hi Dan,
The only possible way that you would get that error is if the
sequence= word did not get a chance to be recompiled. This would
happen if you paste your definitions in the listener, instead of
loading them from a source file.
While 'recompile' is called automatically by run-file, you
I implemented something similar when I wrote libs/gap-buffer. It's called
'circular' and wraps an underlying sequence, allowing indexing to start from
any point in the sequence and wrap around.
TUPLE: circular start ;
C: circular ( seq -- circular )
0 over set-circular-start [ set-delegate ]
An easy way to show the problem is:
! this works
1 T{ circle f "abc" 0 } nth .
! This gives an error about nth not being a method for circle
1 T{ circle f "abc" 0 } nth-unsafe .
! This works if you step-in through the code, but not if you 'continue'
1 T{ circle f "abc" 0 } [ nth-unsafe ] walk
C
Hi all
I'm trying to implement a particular datastructure in Factor for XML
parsing. It's sorta like a circular list. The code is at
http://paste.lisp.org/display/35077 . For some reason, it works when I
use things like length, nth and set-nth, but >string and sequence=
don't work, complaining tha