Hi,
Sorry to post yet again! I've been trying to write something to read lines
from a file while ignoring comments, and have gotten this far:
: readln-skipcomments ( -- line )
[ { [ string? ] [ first CHAR: # = not ] [ ] } 1&& ] [ readln ] do while
;
The problem is that it seems that while consumes the result of running
pred, so this ends up not returning anything. If I put a dup into the last
entry in the 1&&, to leave an extra copy on the stack in case of success,
then I get a deep error complaining that the stack effect of the inputs of
1&&'s internal ifs are unbalanced. If I put the dup after the 1&& in the
while I get an error that pred is unbalanced. If I put it in the looped
quotation I get the error that the loop is not balanced by pred. Is there
any way I can do this?
Mark
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk