00:00:00 --- log: started forth/09.08.09 00:06:52 --- join: rgbbb (n=username@219-90-185-12.ip.adam.com.au) joined #forth 00:13:30 --- quit: gerfd (Read error: 60 (Operation timed out)) 00:31:23 --- quit: rgbbb ("Leaving") 01:16:59 --- join: kar8nga (n=kar8nga@e-37.vc-graz.ac.at) joined #forth 03:21:38 --- quit: kar8nga (Read error: 110 (Connection timed out)) 03:24:42 --- join: impomatic (n=John@nat67.mia.three.co.uk) joined #forth 05:28:28 --- join: _mathrick (n=mathrick@users177.kollegienet.dk) joined #forth 05:28:37 --- quit: mathrick (Remote closed the connection) 05:30:49 --- join: gogonkt_ (n=info@59.38.223.225) joined #forth 05:34:50 --- quit: gogonkt (Read error: 110 (Connection timed out)) 06:12:27 --- nick: gogonkt_ -> gogonkt 06:19:21 --- join: mathrick (n=mathrick@wireless.its.sdu.dk) joined #forth 06:23:14 --- quit: _mathrick (Read error: 110 (Connection timed out)) 07:46:49 --- join: GeDaMo (n=gedamo@212.225.115.96) joined #forth 08:40:24 --- quit: madgarden (Read error: 110 (Connection timed out)) 08:52:16 --- quit: gnomon (Read error: 110 (Connection timed out)) 08:58:15 --- join: madgarden (n=madgarde@CPE001d7e527f89-CM00159a65a870.cpe.net.cable.rogers.com) joined #forth 08:59:19 --- quit: GeDaMo (Remote closed the connection) 09:00:11 --- join: GeDaMo (n=gedamo@212.225.115.96) joined #forth 09:44:42 * impomatic is trying to implement DO LEAVE LOOP with the technique suggested the other day. 09:45:06 Problems? 09:45:33 Not yet. Should be fine for nested loops both with LEAVE 09:46:00 LEAVE only leaves the inner loop anyway 09:46:19 It seems a neater solution than having the runtime code for DO placing and extra address on the return stack for all the LEAVE to use. 09:47:17 : LEAVE JMP, HERE LEAVE-LIST @ , LEAVE-LIST ! ; IMMEDIATE 10:16:20 GeDaMo: I don't think that would work for nested DO LOOPs would it? 10:16:35 Leave only works for the inner loop 10:17:06 So each loop-sys would have it's own leave-list pointer 10:17:13 Yes, but if the outer loop also contains LEAVE? 10:17:37 ... do ... do ... leave ... loop ... leave ... loop 10:17:45 Should work fine 10:18:25 But not DO ... LEAVE ... DO ... LEAVE ... LOOP ... LOOP 10:18:34 Yes, it should work for that as well 10:19:12 Wouldn't the outer loop's leave-list be overwritten by the inner loop's leave list? 10:19:25 No, because they're separate 10:19:49 DO places a loop-sys structure on the control stack 10:20:18 I assume LEAVE-LIST is a variable pointing to the latest leave? 10:20:22 It contains a LEAVE-LIST pointer 10:20:32 No, it's a field in the loop-sys 10:21:09 Ah okay. I understand now. 10:23:21 Also the LOOP must update and compare the loop counters, jump back to DO if neccessary, otherwise remove the loop-sys from the control stack 10:23:46 Somehow I need to resolve the LEAVE to point to the code that removes the loop-sys. 10:23:49 --- quit: mathrick (Read error: 110 (Connection timed out)) 10:24:19 Yes, it's just a case of following the list and replacing each element with the address of the loop clean-up 10:25:36 I think it might be easier to just put a pointer to after LOOP in loop-sys and implement LEAVE as removing the loop-sys and jumping to that address. 10:26:06 Something like : LEAVE 2R> 2DROP EXIT ; 10:27:01 Is that LEAVE's compile time or run time behaviour? 10:27:41 runtime, it wouldn't be an immediate word. 10:27:49 Remember the loop-sys doesn't exist at run time 10:28:48 Sorry, I was confused 10:28:50 :P 10:28:58 No, but the code compiled by DO should put 2 values on the return stack for the loop counter and bound. 10:29:19 do-sys is the compile time data structure, loop-sys is the run time one 10:29:31 It could put three values on the return stack. The address after LOOP, and the 2 values. 10:30:23 Ah okay. Then do-sys should contain the extra address. 10:30:30 --- join: Quartus` (n=Quartus`@74.198.12.5) joined #forth 10:31:00 No, you were right the first time, it would be there at run time 10:31:32 Although your LEAVE would have to drop three address from the return stack then just return 10:31:37 ^addresses 10:32:06 Then LEAVE isn't immediate and just takes the address from do-sys, then drops do-sys and jumps to the address. 10:32:10 But mine was smaller ;-) 10:32:38 : LEAVE 2R> R> 2DROP DROP ; = 1 word more :-( 10:32:59 Your one was smaller but it wouldn't have worked :P 10:33:11 Wait, ignore that :-) 10:33:16 You forgot about the caller's address on the return stack 10:35:31 : LEAVE 2R> 2DROP 2R> NIP EXECUTE ; maybe? 10:35:57 -> (18:32:38) impomatic: : LEAVE 2R> R> 2DROP DROP ; 10:36:03 That one's right 10:36:27 Argh! I'm poluting the channel with broken code :-( 10:40:12 I think I'll do it this way. The compiled code is more compact. I don't like the idea of jumping to halfway through the code for LOOP. 10:40:35 Although it would be possible to set the loop counter to the bound I suppose. 10:40:53 I'm not sure what you mean 10:41:28 LEAVE doesn't have to care about the loop counter 10:42:42 No, but if it changed the counter to bound, LEAVE could jump to LOOP and know that it would fall through and exit. 10:43:03 But you'd still have to cleanup the loop 10:43:47 The code compiled by LOOP would do that when it fell through. 10:44:02 But then why not just jump to that point? 10:44:17 Actually that's quite a messy solution when I try to implement it :-( 10:44:56 I want LOOP to compile just one word. 10:45:12 Why? 10:45:48 It seem's tidier. 10:46:39 Hmmm... actually I guess it normally compiles to about 4 words 10:49:56 Fig Forth compiles a (LOOP) word that handles everything, followed by an address. 10:54:20 --- join: mathrick (n=mathrick@users177.kollegienet.dk) joined #forth 10:55:12 So your DO does all the work and LOOP just jumps back to the DO? 11:04:24 I'll write some code to demonstrate. DO should be : DO ['] >2R , HERE ; and LOOP should be : LOOP ['] (LOOP) , , ; 11:05:57 (LOOP) is a word that does all the work and probably has to be a primitive. I just need to add LEAVE support. 12:30:06 I can't find a word to convert a string to upper (or lower) case. I assume there isn't one in common use? 12:33:41 impomatic: Gforth has toupper for single characters 12:42:35 Thanks 14:13:42 --- quit: GeDaMo ("Leaving.") 15:07:40 --- join: MaTeusS (n=mateusga@200-163-246-83.pbcta200.dial.brasiltelecom.net.br) joined #forth 15:11:15 hellooo people 15:13:16 hello 15:14:05 --- mode: ChanServ set +o crc_ 15:14:10 --- nick: crc_ -> crc 15:14:23 wow nobody here like to talk 15:16:02 most of us just lurk here :) 15:18:41 --- part: MaTeusS left #forth 17:24:23 --- join: gnomon (n=gnomon@CPE001d60dffa5c-CM000f9f776f96.cpe.net.cable.rogers.com) joined #forth 17:29:28 --- quit: Quartus` (Read error: 110 (Connection timed out)) 17:40:32 --- quit: Deformati (Read error: 110 (Connection timed out)) 19:28:45 --- join: kspaans (i=kspaans@artificial-flavours.csclub.uwaterloo.ca) joined #forth 19:31:32 --- part: kspaans left #forth 19:57:15 --- join: cataska (n=cataska@210.64.6.235) joined #forth 20:37:38 --- part: cataska left #forth 22:29:38 --- join: gnomon_ (n=gnomon@CPE001d60dffa5c-CM000f9f776f96.cpe.net.cable.rogers.com) joined #forth 22:31:26 --- quit: gnomon (Read error: 104 (Connection reset by peer)) 22:45:56 --- join: kar8nga (n=kar8nga@a-32.vc-graz.ac.at) joined #forth 23:31:16 --- quit: kar8nga (Remote closed the connection) 23:59:59 --- log: ended forth/09.08.09