Hi,
New to factor, did some forth long time ago. Converting
unmaintained\odbc.factor for use on Windows. Am using the binary factor
deploy for now.
1) CHAR: \space <string> is missing \space.
a) Of course CHAR: 32 <string> works, but it seems we avoid this. What
is better way?
b) Closest I can come is command-writer.factor, which has a CHAR: space
write1. I can't figure out where space is defined. I think I looked (but
obviously missed it) in each file in USING: io io.crlf kernel math.parser
sequences strings interpolate locals ; and browser is not helpful. What
techniques are there to start from command-writer & find out where it thinks
it's getting the word from?
2) finding conflicts for TYPEDEF: short XXX.
a) says between alien.c-types & sequences
b) I read the latter should win in USING: but this doesn't seem to apply
c) I read syntax << "alien.c-types" xxx >> would help, but can't find
that article now, and couldn't figure out exact syntax at the time.
d) I actually fixed by moving to an ffi folder so it didn't have any
code requiring sequences, which may be correct, but I'd like to understand
c) or whatever name conflict resolution there is.
3) Use of >r r>
a) I remember this from forth, but it seems to be stamped out, and may
even by a religious argument?
b) As a quick and ugly, I implemented this as
SYMBOL: fakestack
: init-fake-stack ( -- )
8 <vector> fakestack set ;
: >r ( n -- ) fakestack get push ;
: r> ( -- n ) fakestack get pop ;
init-fake-stack
which may be safe, because there's no call of another routine that uses >r
from the first >r to the last r>. In a few routines, I changed to :: and
used named locals. I switched to the above when one routine
(odbc-describe-column) put 6 elements on the return stack. I first tried
solving this as a tuple, but then thought of the trick, and wanted to learn
how to implement it.
c) is there a better temp stack technique?
d) please don't suggest other rewrites of odbc-describe-column, I will
eventually come back to it.
Thanks!
--
Jim
"I'm for extending the working Medicare program for our seniors all the way
back to contraception, so Americans can concentrate on living their lives
without fear of changing a job, going bankrupt from deductibles or fighting
HMO bureaucracy."
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk