00:00:00 --- log: started forth/09.08.06 00:21:21 --- quit: kar8nga (Remote closed the connection) 01:42:54 --- quit: aguai_ (Read error: 54 (Connection reset by peer)) 02:40:02 --- join: tathi (n=josh@dsl-69-50-53-152.pivot.net) joined #forth 02:46:53 --- quit: tathi ("leaving") 02:50:37 --- join: GeDaMo (n=gedamo@212.225.107.61) joined #forth 02:58:43 --- quit: cataska ("leaving") 04:53:28 --- quit: GeDaMo ("Leaving.") 06:58:47 --- join: GeDaMo (n=gedamo@212.225.107.61) joined #forth 07:18:05 --- join: ehird (n=ehird@91.104.244.142) joined #forth 07:18:26 Is there a "word q" → "[char] q emit"? 07:20:30 I don't know one off-hand 07:21:40 guess it isn't really as common as it seemed when i wrote that line :) 07:36:20 --- quit: proteusguy (Read error: 60 (Operation timed out)) 07:42:53 --- join: Maki (n=Maki@dynamic-78-30-139-176.adsl.eunet.rs) joined #forth 07:48:26 --- join: madwork_ (n=madgarde@204.138.110.15) joined #forth 08:05:43 --- quit: madwork (Read error: 110 (Connection timed out)) 08:13:25 Is there a better way to write `dup @ 1+ swap !`? I'm trying to get a better grasp of things by writing random words... 08:24:01 ehird: looks ok 08:24:12 :) 08:24:26 http://forth.sourceforge.net/mirror/comus/index.html 08:24:50 thanks 08:25:11 I had the impression that there might be a word in comus for that but I couldn't see one 08:45:16 --- join: kar8nga (n=kar8nga@e-38.vc-graz.ac.at) joined #forth 09:00:39 --- quit: kar8nga (Remote closed the connection) 10:12:49 --- join: impomatic (n=John@nat67.mia.three.co.uk) joined #forth 10:12:51 Hi :-) 10:13:07 Hi impomatic :) 10:14:02 Hi GeDaMo. I've not made much progress this week, I'm hoping to change that tonight. 10:15:33 Most of the words I've got left parse the input in some way, ' ['] literal postpone char ." evaluate and so on. 10:16:47 impomatic: this the corewar forth thing? 10:22:15 --- nick: madwork_ -> madwork 10:23:36 ehird: no, it's in 8086 assembly to be translated later to AVR assembly 10:23:43 ah 10:25:42 The corewar Forth is here: http://corewar.co.uk/assembly/forth.htm 10:26:30 That's the final version for now, although I'm tempted to translated the Forth I'm working on to redcode, if ARES can handle it 10:33:23 --- join: kar8nga (n=kar8nga@a-18.vc-graz.ac.at) joined #forth 10:41:44 Is anyone planning to attend EuroForth? 10:55:10 I can't see any way in the standard to get a pointer to the most recently defined word. Have I missed something? If not, is there a variable in common use? Jones uses LATEST. 10:56:58 latest ok 10:56:58 . 3359064 ok 10:57:00 gforth 0.7 10:57:03 I don't think there's anything in the standard for that 10:57:10 so that's two pieces of precedent 11:03:15 --- join: gnomon_ (n=gnomon@CPE001d60dffa5c-CM000f9f776f96.cpe.net.cable.rogers.com) joined #forth 11:04:27 Seems to work in PFE too, but I'm not sure if it's returning the execution token or the header. 11:05:27 There's a lastxt in Gforth 11:05:56 --- quit: gnomon (Read error: 104 (Connection reset by peer)) 11:07:02 I was hoping LATEST @ 10 TYPE would display whatever's there as ascii, but it just gives an exception :-( 11:07:42 latest doesn't appear to give a memory address in gforth 11:07:55 Try latest 10 dump 11:08:08 (lastxt @ 10 type) works 11:08:14 if ?????(?? counts as working 11:16:06 ehird: I'd put my money on there being lotsa unprintable characters, so ?????(?? looks just fine. 11:16:14 yep 11:16:25 dump seems more fun (: 11:17:00 if you're BORING! 11:17:10 i just read the spiritual energy of the question marks. 11:19:15 yes. that is what forth is all about (: 11:19:44 (spiritual energy, not boring) 11:25:18 lastxt doesn't work in PFE. latest returns a pointer to the counted string for the word's name 11:29:10 So why can't ya type it? 11:31:19 I can now. I was expecting PFE's latest to be a variable like Jones' latest. But it's not, it puts the address directly on the stack. 11:32:43 latest 10 type works fine and displays the name. Any attempt to read cells beyond the name generates an exception 11:38:27 aha 11:42:41 ehird: what does lastxt @ 20 - 30 return? 11:43:14 Sorry, I mean lastxt @ 20 - 30 type 11:44:03 lastxt returns an address like latest 11:46:42 In Gforth, lastxt is 16 bytes after latest 11:47:55 I was just trying to work out if lastxt return the address of a cell containing the address of the last xt defined (like a normal variable) or if it returns the address of the last defined xt 11:48:21 It's the address of the last defined xt 11:48:58 You can do lastxt execute 11:49:31 Thanks, so it works like HERE. 11:49:39 Yes 11:51:53 I wonder why something like latest / lastxt didn't get included in the standard. Is there a named variable used in GForth with lastxt? 11:51:57 I think I'll download GForth :-) 11:53:25 Does PFE implement see? 11:54:07 In Gforth, both latest and lastxt appear to use user variables 11:54:29 : latestxt useraddr <72> @ ; 11:54:32 Yes, but everything is a primative I think 11:54:49 : latest useraddr <76> @ ; 11:58:13 --- quit: ehird () 12:01:34 --- quit: impomatic ("mov.i #1,1") 12:03:06 --- join: impomatic (n=John@nat66.mia.three.co.uk) joined #forth 12:10:55 --- join: ehird (n=ehird@91.104.244.142) joined #forth 12:11:47 impomatic: lastxt @ 20 - 30 type ??$??$?????????(?? ok 12:16:47 ehird: thanks. I think it might output some text if you use lastxt 20 - 30 type 12:17:04 indeed; lastxt 20 - 30 type ??2?disasm ?O> ok 12:17:47 Thanks :-) 12:24:47 --- nick: gnomon_ -> gnomon 12:53:41 * impomatic wonders if he ought to register http://www.forth201x.org 12:54:30 FSVO x 12:54:41 The new standard seems to be dragging out 13:17:24 --- join: k (n=kar8nga@a-16.vc-graz.ac.at) joined #forth 13:17:52 --- nick: k -> Guest42650 13:18:26 --- quit: kar8nga (Nick collision from services.) 13:18:28 --- nick: Guest42650 -> kar8nga 13:23:55 --- quit: GeDaMo (Read error: 110 (Connection timed out)) 13:26:06 --- join: GeDaMo (n=gedamo@212.225.115.96) joined #forth 13:42:10 is there not even a word that encompasses "x @ ... x !"? 13:43:14 That looks like a job for CREATE .. DOES> :P 13:43:42 yep, time to learn how to use those :} 13:43:56 heh... I understand more or less how forth is compiled, but not how you utilise the mode 13:43:56 l 13:45:16 ah 13:45:28 GeDaMo: I meant something along the lines of, 13:45:44 "x THINGY ... ANOTHERTHINGY" 13:45:49 → x @ ... x ! 13:45:51 * impomatic wonders if anyone ever wrote a microkernel in Forth 13:47:42 uh oh, I need to rewrite this forth... I just turned into a double-@ programmer 13:47:45 :-D 13:47:58 : updater: create , does> @ over @ swap execute swap ! ; 13:48:09 ' 1+ updater: update1+ 13:48:20 GeDaMo: x doesn't vary 13:48:22 ... varies 13:48:52 x is on the stack 13:49:18 But you could always write it for a fixed x 13:49:18 GeDaMo: that's not what i mean 13:49:28 `' 1+ updater: update1+` is useless, because it will only be used onc 13:49:28 e 13:49:40 What do you mean? 13:49:41 the point is just to avoid the redundancy of writing x twice in 'x @ ... x !' 13:49:51 as opposed to, say, 'x update: ...' 13:49:55 update1+ can increment any variable 13:50:05 i know 13:50:10 but that's not needed, at all 13:50:30 GeDaMo: firstly, it would be more than just 1+ 13:50:43 so you'd have to define a word just for the purpose 13:50:46 secondly, you'd only call it once 13:51:24 somehow I don't think ": foo ... ; ' foo updater: updatefoo : theword var foo ;" is better than ": theword var @ ... var ! ;" 13:51:53 Depends what you're actually trying to do 13:53:24 I simply noticed that I do "x @ manipulate x !" a lot, for varying x and manipulate 13:53:48 whereas that could be replaced with "x SOMETHING manipulate SOMETHINGELSE", to avoid repeating x 13:53:48 You may be using too many variable references 13:54:25 so what, every time I want to modify a variable's value based on the previous one I should write "variable-name @ modify variable-name !"? 13:54:28 that seems silly. 13:54:43 You could define a new word to do the manipulation. 13:55:09 No, what I mean is that values are normally passed around on the stack 13:55:37 GeDaMo: I know that, but that would just result in me emulating a variable with the stack in these cases 13:55:48 to comedically spaghetti results... 13:55:52 Welcome to Forth! :P 13:56:02 impomatic: but the manipulation isn't reused! 13:56:09 no part is reused apart from writing the variable name twice 13:56:52 That's not really worse than most languages is it? 13:57:02 most, no 13:57:06 I know c has x += 5 13:57:22 But most use x = x + 5 or similar 13:57:28 err, what? 13:57:31 += is incredibly common in C 13:57:39 I've never seen anyone who isn't a newbie do "x = x + ..." 13:59:19 anyway in lisp you could do e.g. (modify variable-name + 1 x) turning into (set! variable-name (+ 1 x variable-name)) 13:59:24 of course that's limited in just adding it to the end of an argument list 13:59:25 What I mean is apart from C, most languages would use x = x + 5 or similar. E.g. Basic, Pascal, Occam, Fortran 14:00:04 Yes, well, if I wanted something as verbose and inflexible as those languages I'd use them :-) But since you use names all the time in those languages, you can't express your manipulations without reusing the name, so it feels natural 14:00:15 But it doesn't sit as well with me when that isn't nearly as common 14:00:43 : dothis: s" dup @ " evaluate ' compile, s" swap !" evaluate ; immediate 14:00:49 : test x dothis: 1+ ; 14:01:00 looks good! 14:01:19 is evaluating constant strings there really the best way? seems od 14:01:21 *odd 14:01:53 You could probably do somethig with postpone 14:03:03 what does the > mean in DOES>, btw? 14:03:04 why not DOES:? 14:03:32 I suppose it's pointing to the code 14:03:37 cute 14:07:54 --- quit: kar8nga (Remote closed the connection) 14:08:19 GeDaMo: i assume s" ..." evaluate isn't the same as ... in an immediate word? 14:08:41 eForth's . displays numbers as unsigned if the base isn't decimal. PFE doesn't 14:08:52 No, it compiles ... into the word which is currently being compiled 14:09:00 right 14:09:03 I just haven't seen it being used before 14:09:31 Same as postpone ... for every word in the s" ..." 14:09:40 yeah 14:12:01 I didn't expect to get bogged down with so many implementation issues. 14:12:15 people write portable forth programs?!?!?! 14:13:14 * impomatic should've listened to schme's advice. 14:13:16 I think it's normal to take a big piss on the standard when it suits you ;) 14:14:53 ehird: I think I got using evaluated strings for macros from Neil Bawd's page 14:15:54 Actually, it's in comus 14:17:56 It's in his toolbelt too: http://home.earthlink.net/~neilbawd/tool2002.txt 14:37:54 I don't really understand the point of <# # #s #> etc. :-( 14:38:18 It's just as easy to use the stack. E.g.: 14:38:46 : . dup 0< if negate [char] - emit then base @ /mod ?dup if recurse then [char] 0 + dup [char] 9 > if 7 + then emit ; 14:41:12 what're those 14:42:02 Number conversion, from a number on the stack to something formatted for output. 14:42:28 . uses them to format the number. 14:43:15 --- join: ehird_ (n=ehird@91.104.243.206) joined #forth 14:43:17 Maybe so you can do clever things like thousands separators? 14:43:31 Hmmm... 14:43:48 * impomatic wonders if anyone has ever done that. 14:43:56 I'm just trying it now :P 14:44:25 I imagine it's just as tricky either way. 14:53:07 impomatic: 1000 s>d <# # # # char , hold # .s #> type 14:53:41 You don't need the .s :P 14:55:28 Hmmm... interesting, but that only formats numbers between 1000 and 999999 nicely :-) 14:55:57 Loops may be required :P 14:56:27 --- quit: Maki ("Leaving") 14:56:53 Okay I admit using <# etc is also smaller than my recursive monster above. 14:57:13 E.g. : . >r r@ abs 0 <# #s r> sign #> type space ; is the smallest I could make 14:59:01 --- quit: ehird (Read error: 110 (Connection timed out)) 14:59:58 bye ehird 15:04:30 --- quit: GeDaMo ("Leaving.") 15:55:38 --- join: gnomon_ (n=gnomon@CPE001d60dffa5c-CM000f9f776f96.cpe.net.cable.rogers.com) joined #forth 16:11:00 --- quit: gnomon (Read error: 110 (Connection timed out)) 18:23:09 --- quit: ehird_ () 20:22:53 --- quit: schme ("leaving") 20:23:05 --- join: schme (n=marcus@c83-249-82-26.bredband.comhem.se) joined #forth 21:15:29 --- quit: gnomon_ (Remote closed the connection) 21:15:42 --- join: gnomon (n=gnomon@CPE001d60dffa5c-CM000f9f776f96.cpe.net.cable.rogers.com) joined #forth 22:53:07 --- join: kar8nga (n=kar8nga@a-31.vc-graz.ac.at) joined #forth 23:33:37 --- quit: kar8nga (Remote closed the connection) 23:59:59 --- log: ended forth/09.08.06