02:35:30 --- log: started forth/06.01.31 02:35:30 --- join: clog (n=nef@bespin.org) joined #forth 02:35:30 --- topic: 'Welcome to #forth. We discuss the Forth programming language, simplicity, and a variety of technical subjects. The rules are simple: don't spam, don't troll, and please speak English.' 02:35:30 --- topic: set by Quartus on [Sat Jan 21 17:32:55 2006] 02:35:30 --- names: list (clog Cheery sproingie Quartus PoppaVic rehges nanstm segher_ MetaDisciple Snoopy42 Teratogen I440r warpzero madgarden Ray_work Robert saon madwork skylan @crc) 03:08:59 --- quit: PoppaVic ("Pulls the pin...") 03:56:09 --- join: venandocarvarow (n=venandoc@h062040252003.plc.cm.kabsi.at) joined #forth 03:56:38 --- quit: venandocarvarow (Client Quit) 03:57:13 --- join: venandocarvarow (n=venandoc@h062040252003.plc.cm.kabsi.at) joined #forth 04:41:55 --- part: venandocarvarow left #forth 04:46:25 --- quit: rehges () 04:56:15 --- join: jungledog (n=dschauer@adsl-68-95-36-98.dsl.lgvwtx.swbell.net) joined #forth 05:09:42 --- join: JasonWoof (n=jason@c-71-192-33-206.hsd1.ma.comcast.net) joined #forth 05:09:43 --- mode: ChanServ set +o JasonWoof 05:16:02 --- join: venandocarvarow (n=venandoc@h062040252003.plc.cm.kabsi.at) joined #forth 05:21:07 hello venandocarvarow 05:21:38 --- join: Lars_G (n=lars@unaffiliated/lars-g/x-000001) joined #forth 05:21:48 ." Hello all" 05:21:53 hi :) 05:22:11 hello :-) 05:29:45 --- quit: venandocarvarow ("Download Gaim: http://gaim.sourceforge.net/") 05:31:04 the trouble with gaim is there's no grep -r 06:07:00 --- join: snoopy_1711 (i=snoopy_1@dslb-084-058-180-097.pools.arcor-ip.net) joined #forth 06:14:08 --- quit: Snoopy42 (Read error: 145 (Connection timed out)) 06:14:08 --- nick: snoopy_1711 -> Snoopy42 06:55:28 --- quit: madgarden (Read error: 104 (Connection reset by peer)) 07:11:59 --- quit: jungledog (Read error: 101 (Network is unreachable)) 07:15:26 --- quit: madwork (Read error: 110 (Connection timed out)) 07:18:40 --- join: madwork (n=foo@derby.metrics.com) joined #forth 07:38:13 --- quit: Cheery ("Leaving") 07:46:50 --- join: segher (n=segher@dslb-084-056-142-132.pools.arcor-ip.net) joined #forth 07:58:57 --- quit: segher_ (Read error: 110 (Connection timed out)) 08:24:26 --- join: madgarden (n=madgarde@London-HSE-ppp3546494.sympatico.ca) joined #forth 08:32:12 is there a word in gforth that takes an xt and prints its name? 08:36:26 >name .name will do it 08:36:59 so...... ' noop >name .name for instance 08:51:28 oh 08:51:34 I came up with ' noop look .name 08:51:44 not sure what look does 08:52:15 hmm... actually: ' noop 0; .name 08:52:17 oops 08:52:19 gah! 08:52:28 ' noop look 0; .name 08:59:08 yikes. Seems complex. 08:59:31 Oh. >name does look and 08:59:42 ' noop look and .name 08:59:44 same thing 09:00:00 What's 0; ? 09:02:14 --- join: venan (n=venandoc@h062040252004.plc.cm.kabsi.at) joined #forth 09:05:05 Quartus: 0; exits the word if TOS is 0. If it's 0, it also does a DROP, otherwise it leaves TOS alone 09:05:22 Not a gforth word in 6.2 09:05:37 0; is non standard 09:05:57 Lots of non-standard words in gforth, but I thought JasonWoof was asking about gforth specifically. Thought maybe 0; was some new addition. 09:07:17 If it's defined as you say, then it wouldn't properly replace 'and' in that sequence. 09:07:59 Unless I'm misunderstanding. Is it 0= if drop exit then or dup 0= if drop exit then ? 09:08:14 I think the second 09:08:30 Then it wouldn't replace AND. 09:17:42 whats wrong with ?exit ? 09:18:10 oh i get it. the second example eats 2 stack items 09:18:46 I generally dislike words that have variable numbers of return values. 09:19:13 well i think they are ok as long as the top item is a flag or a count lol 09:19:24 but yeat... not if you overuse it 09:19:37 The variable return ones are the ones I always have to look up to see what's going to happen. 09:36:00 --- nick: MetaDisciple -> Quiznos 09:36:43 oh sorry, 0; is one of my words 09:37:03 man, I'm overflowing the return stack. how do you do tail-recursion in gforth? 09:37:34 Fake it with begin/again 09:37:46 do I have to? 09:37:49 that's so pathetic 09:37:58 Off the top of my head, I don't know if there's a tail-recursion word in gforth. 09:38:05 grrrr 09:38:11 There's recurse, of course. 09:38:33 You could write a 'tail-recurse' word pretty easily, I'd guess. 09:38:43 \ the words below exit on a certain condition, and drop on a certain condition 09:38:43 \ exit-if drop-if 09:38:43 : 0; dup if exit then drop rdrop ; \ false false 09:38:43 : 0=; if exit then rdrop ; \ false always 09:38:43 : if; if rdrop exit then ; \ true always 09:38:46 : t; dup if rdrop exit then drop ; \ true false 09:38:48 : f; 0= if rdrop 0 exit then ; \ false true 09:40:37 I don't know how to make a branch... investigating 09:41:17 heh, there's a word called "branch" but it's machine code 09:41:31 I'd be a lot happier if I could get stack comments for gforth words 09:41:57 afaik, tail-recusion is just the organising of code so that the last op/word at the end of a function is a jmp to the beginning of the same function, thus no ret addr is stored 09:42:42 Quiznos: right 09:42:45 a loop just mentioned might make it fakable but i'm not sure 09:42:49 Quiznos: I just don't know how to get gforth to do that 09:42:49 I440r 09:43:07 it's more conceptual than concrete 09:43:11 "recurse ;" does not produce the jmp I'd like, it compiles a call, (which pushes the rstack) and a return 09:43:26 that's the concrete part, something compiling has to do 09:44:05 first, it can be considered a loop, so begin-again could be used, but dont forget to make a leave-door for yourself 09:44:24 Ok, I wrote one. 09:44:43 it's a lisp/scheme thing 09:44:59 It's far from pretty to look at, but here it is: 09:44:59 create tail-mark 3 cells allot 09:44:59 : : : postpone begin tail-mark ! tail-mark cell+ ! tail-mark 2 cells + ! ; 09:44:59 : tail-recurse tail-mark 2 cells + @ tail-mark cell+ @ tail-mark @ postpone again ; immediate 09:45:14 Gforth 6.2-specific, it knows that begin leaves 3 cells on the data stack. 09:45:37 There may be a more clever way to accomplish the same thing, but that'll do it. 09:46:16 It's a tad more flexible than automatic tail-recursion optimization, you can use 'tail-recurse' anywhere in a word to branch back to the beginning. 09:47:02 Likely there's a far better name to be found than 'tail-recurse'. 09:47:38 is it a sentinel word to handle the whole thing? 09:47:45 Sentinel? 09:47:50 marker 09:48:15 Quiznos, what are you trying to get gforth to do? 09:48:20 i bet isforth can do it :) 09:48:20 Not sure what you mean. I've redefined : so that it does a BEGIN and stores the dest away. tail-recurse retrieves a copy of it, and codes an unconditional branch. 09:48:28 I440r, it's JasonWoof. Wants tail recursion in gforth. 09:48:34 I440r not me, i was just chiming in 09:48:42 aha :) 09:48:57 I440r you and I chatted a few years ago (i dont recall my nick then tho :) 09:48:59 isforth can do tail recursion but only on demand 09:49:02 not behind your back 09:49:13 where u from ? 09:49:16 pa 09:49:20 penns. 09:49:42 i was on dialup back then 09:49:44 :) 09:49:49 sorry, phone. I'll catch up in a bit 09:50:32 hmmm dont recall u :) 09:50:37 i know 09:50:51 i didnt expect you to 09:50:54 what did we chat about ? 09:51:00 your forth 09:51:09 good topic !!! ;) 09:51:12 heh yea 09:51:13 do u use it ? 09:51:34 not as often as you'd like but other things press me 09:51:47 ive not done much work on it in a while 09:51:51 i still have a forth mentality tho 09:51:58 thing is i got lots of time too 09:51:59 :/ 09:52:13 i think in forth, rather it helps that way 09:53:32 when you learn forth you become a better code in OTHER languages too 09:55:37 this is true 09:56:09 my biggest realisation is just how badly other code in other langauges is written by programmers 09:56:19 all I see is inefficiency 09:56:21 specially c 09:56:26 which is why i dont like c 09:56:28 does that make me a bad geek? 09:56:55 :) 09:56:58 heh 09:57:02 i code what pays the bills 09:57:08 except bb/.net/java...... 09:57:12 erm vb even 09:57:16 ick 09:57:18 heh 09:57:22 ew and ewil 09:57:28 Mmm... Java. 09:57:38 * Robert throws a rotten applet at I440r. 09:57:48 heh 09:59:31 --- part: venan left #forth 09:59:58 I think I scared him away. :) 10:01:12 no you missed 10:01:24 but i wont miss with my 30-06 or my new 270 :P 10:02:26 savave 110 10:02:33 just zeroed it in at 100 yards the other day 10:02:34 Oh, I meant venan. 10:02:38 shoots like a dream!!! 10:02:48 lol 10:02:50 --- quit: Lars_G ("Leaving") 10:03:03 i'd like to larn how to shot 10:03:04 Hooray! Now you can start a militia and throw that commie Bush out of office. 10:04:01 and replace him with who? 10:04:05 john fonda kerry ? 10:04:17 algorle ? (like egor but different) 10:04:28 algore even 10:04:37 grrr i MUST learn to type 10:04:43 crap i cant find my b-complex 10:05:23 I440r: Nah, you could always dig up some 18th century nutcase and pretend he's alive. 10:06:00 :) 10:06:04 write now, and for several years i've been thinking of The Great American Forth 10:06:16 (think Novel) 10:06:40 it sings, it dances, it could even talk back (maybe) 10:06:56 * Robert is working on a simple radio link - would be fun to make a small Forth computer using only a radio modem as I/O. 10:09:39 ncis, according to jim, and rodney to night 10:09:42 oops 10:12:36 i've also been planning an simple ai that doesnt use the standard formulas 10:14:37 1+1=3. GENIUS! 10:15:04 what's wrong with that, ejucators call it fuzzy-math 10:15:45 I call it just 'wrong', but then I'm a pragmatist. :) 10:15:55 heh 10:16:02 and think of stats! 10:19:07 Stats can certainly be mis-used. 10:19:24 it takes real skill to abuse a language 10:19:29 any langauge 10:19:50 my lang of skill is engrlish 10:20:54 Indeed? 10:21:04 figers-of-speech 10:21:29 it's an off-the-cuff thing 10:21:34 writing 11:16:48 --- nick: nanstm -> Raystm2 11:47:10 hehe 12:12:43 --- quit: Raystm2 ("Raystm2 has decided to ignore the entire internet, so sorry you had to he there.") 12:19:22 --- join: Raystm2 (n=Raystm2@adsl-69-149-52-52.dsl.rcsntx.swbell.net) joined #forth 14:00:02 --- join: louis_to (n=louis_to@CPE0011240d7818-CM0014045b56e2.cpe.net.cable.rogers.com) joined #forth 14:00:51 --- part: louis_to left #forth 14:22:07 --- join: amca (n=plump@as-bri-4-1-136.ozonline.com.au) joined #forth 14:22:12 --- quit: amca (Read error: 104 (Connection reset by peer)) 14:41:14 --- join: asymptote (n=weldon@199.73.33.14) joined #forth 14:51:32 --- quit: asymptote ("Leaving") 15:04:31 --- quit: Ray_work (Read error: 104 (Connection reset by peer)) 15:05:59 --- join: Ray-work (n=Raystm2@adsl-68-93-111-214.dsl.rcsntx.swbell.net) joined #forth 15:09:49 --- join: yoyoFreeBSD (n=root@222.90.53.41) joined #forth 17:38:20 --- log: started forth/06.01.31 17:38:20 --- join: clog (i=nef@bespin.org) joined #forth 17:38:20 --- topic: 'Welcome to #forth. We discuss the Forth programming language, simplicity, and a variety of technical subjects. The rules are simple: don't spam, don't troll, and please speak English.' 17:38:20 --- topic: set by Quartus on [Sat Jan 21 17:32:55 2006] 17:38:20 --- names: list (clog I440r saon Ray-work Raystm2 madgarden segher madwork Snoopy42 @JasonWoof Quartus Quiznos Teratogen warpzero Robert @crc skylan) 17:38:59 It looks crazy 17:39:22 Not complicated. Makes : do a BEGIN by default, and then store the dest addr away. 17:39:38 So happens that in gforth 6.2, a dest is three cells (don't ask me why). 17:40:06 what happens if you don't recurse? 17:40:11 Nothing. 17:40:24 does ; automagically clear the crap begin puts on the stack? 17:40:32 Nothing to clear. It's removed and stored. 17:42:00 Works like a charm. 17:42:49 --- quit: Ray-work (Read error: 110 (Connection timed out)) 17:43:14 oh, I get it 17:43:36 that'll work on any forth where BEGIN gives you 3 cells 17:43:52 Sure. 17:44:12 Though three is a weird number, I'd expect one, maybe two if somebody's gone mad with sentinel values. 17:45:06 You could write a hyper-flexible one that did all the calculations and adapted to the Forth in question, but I wouldn't. 17:47:42 nah 17:49:04 : puts 4 cells on the stack in Gforth. I have no idea what the grand design is behind that, I'm afraid to look. 17:49:19 weird 17:49:27 begin puts an address on the stack 17:49:39 it's 8 more than the address I get with LASTXT 17:50:27 I sincerely don't know. I don't poke around in gforth internals any more than I have to, there are some peculiarities in there. 17:57:20 --- quit: saon (Read error: 104 (Connection reset by peer)) 18:01:28 --- join: saon (i=1000@c-66-177-224-184.hsd1.fl.comcast.net) joined #forth 18:15:26 ok, my gforth cgi thing now does templates 18:15:46 ie it reads in a text file, and replaces bits of it, and outputs the result 18:16:14 I don't have anything decent for it to put in place of those bits yet 18:16:38 so for now it just spits out arguments it's parsed from QUERY_STRING 18:18:02 that went quicker than I expected 18:18:36 it might only be another day or two before I have some system set up to do various filtering and encoding things to the data 18:18:53 right now the template is just a simple lookup-and-replace sort of thing 18:18:58 template has ~tag~ in it 18:19:31 so the template engine looks for a string named "tag" and if found outputs it 18:19:41 and it replaces ~~ with ~ 18:19:53 later I'd like to add encodings 18:20:43 so you can do eg "phone.attr" and instead of just spitting out the phone string, it'll spit it out encoded to go in an html tag attribute 18:21:14 so it could be used like so: 19:07:57 --- quit: JasonWoof ("off to bed") 21:36:33 --- join: neceve (n=Clau@unaffiliated/neceve) joined #forth 21:44:49 --- quit: neceve ("Leaving") 21:45:12 --- join: neceve (n=Clau@unaffiliated/neceve) joined #forth 22:00:09 --- quit: neceve ("Leaving") 22:00:28 --- join: neceve (n=Clau@unaffiliated/neceve) joined #forth 22:17:19 --- quit: neceve ("Leaving") 22:17:43 --- join: neceve (n=Clau@unaffiliated/neceve) joined #forth 22:36:22 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 22:39:49 --- join: Cheery (i=Henri@a81-197-18-99.elisa-laajakaista.fi) joined #forth 23:18:11 --- join: PoppaVic (n=pete@0-1pool67-190.nas22.chicago4.il.us.da.qwest.net) joined #forth 23:36:20 --- join: rehges (n=segher@blueice4n1.de.ibm.com) joined #forth 23:59:59 --- log: ended forth/06.01.31