Thanks. It was indeed inspired by the decompiler, and I used :noname originally, but the effect was the same.
It's not obvious from the documentation (page 86) that interpret/compile: creates an immediate word. Also the decompiler leaves the : off. (see interpret/compile: does though: see interpret/compile: : interpret/compile: Create immediate ...) It's been a few years since I used forth, and I've only been playing with gforth for a week or so. At first I couldn't figure out how to get hardware access (memory mapping the hardware, and getting I/O permissions) but then discovered the C interface, and made myself a little C library to do all the tricky stuff). I like gforth! -- Peter Fox <[EMAIL PROTECTED]> Aeroflex Test Solutions Principal Design Engineer Stevenage Any opinions expressed above are http://www.aeroflex.com/ not necessarily those of Aeroflex. Tel: + 44 (0) 1438 742200 -----Original Message----- From: Anton Ertl [mailto:[EMAIL PROTECTED] Sent: 13 January 2004 11:47 To: [EMAIL PROTECTED] Subject: Re: [gforth] Writing my own ." Peter Fox wrote: > > The following code works on gforth 0.5.0: > > decimal > : my_type 10 spaces type ; > noname : 34 parse my_type ; lastxt > noname : 34 parse postpone SLiteral (compile) my_type ; lastxt > interpret/compile: my_." immediate This code is obviously inspired by decompiler output (which you should not trust too far, as the output is not always faithful to the source; better look in the source directly (in this case, quotes.fs should provide a good inspiration). In this case, the main bug is the "(compile) my_type". You should use "POSTPONE my_type" instead. Also: - Declaring my_." as IMMEDIATE is unnecessary at best. - '[CHAR] "' is clearer than '34'. - ':noname' is standard and shorter than 'noname : ... lastxt' - The preferred name for LASTXT is LATESTXT now. We will try to improve the decompiler, however. - anton --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
