00:00:00 --- log: started forth/09.05.10 00:07:00 --- join: schmx (n=marcus@c83-249-81-1.bredband.comhem.se) joined #forth 00:28:32 g'day 00:29:03 --- join: GeDaMo (n=gedamo@212.225.108.65) joined #forth 00:29:16 --- join: chinese (n=yoyo@117.22.133.239) joined #forth 00:34:28 --- quit: yoyofreeman (Read error: 60 (Operation timed out)) 03:24:56 ... 03:27:48 --- join: WastePotato (n=WastePot@unaffiliated/wastepotato) joined #forth 04:47:34 --- quit: GeDaMo ("Leaving.") 06:44:01 --- join: kar8nga (n=kar8nga@a-61.vc-graz.ac.at) joined #forth 06:54:19 --- join: nighty^ (n=nighty@x122091.ppp.asahi-net.or.jp) joined #forth 07:08:19 --- quit: Al2O3 ("I'm heading out, will be back online soon") 08:47:20 --- part: kspaans left #forth 08:48:45 --- join: GeDaMo (n=gedamo@212.225.108.65) joined #forth 09:01:41 --- quit: kar8nga (Remote closed the connection) 09:21:22 --- log: started forth/09.05.10 09:21:22 --- join: clog (n=nef@bespin.org) joined #forth 09:21:22 --- topic: 'Welcome to #forth. We discuss the Forth programming language and a variety of technical subjects. Introduction and Helpful Reading: http://forthfreak.net/index.cgi?FnFC | ANS/ISO Forth Standard doc: http://tinyurl.com/nx7dx | Gforth compiler: http://tinyurl.com/s8uho | http://quartus.net/search | Paste: http://forth.pastebin.ca | http://www.isforth.com' 09:21:22 --- topic: set by I440r on [Fri Feb 13 08:39:24 2009] 09:21:22 --- names: list (clog uiu_ GeDaMo nighty^ WastePotato chinese schmx aguai tathi spec` dkcl madgarden gogonkt proteusguy impomatic X-Scale mathrick @I440r malyn TreyB maht warpzero Deformati KipIngram gnomon ENKI-][ segher kleinjt pippin nighty__ tarbo) 10:32:14 ??? 10:35:50 --- quit: schmx ("leaving") 10:52:50 --- quit: nighty^ (Read error: 110 (Connection timed out)) 11:23:47 ? 11:24:54 --- join: Deformative (n=joe@c-71-238-45-45.hsd1.mi.comcast.net) joined #forth 11:33:26 --- quit: WastePotato () 11:37:03 --- quit: Deformati (Read error: 110 (Connection timed out)) 12:48:11 --- join: benny99 (n=benny@p5486B6DA.dip.t-dialin.net) joined #forth 12:52:29 --- join: kar8nga (n=kar8nga@e-82.vc-graz.ac.at) joined #forth 12:52:36 http://forth.pastebin.ca/1418540 <- any ideas :( ? 12:55:54 : both ' tuck execute >r execute r> ; 12:58:33 benny99: Wait ... what are you asking? 13:00:01 GeDaMo, sorry, I tried to 'test' it -- I want to invoke 'test' and '<2> 25 36' as output 13:00:20 GeDaMo, tuck appears to be a good idea anyway :) 13:01:09 I think you need to use create ... does> rather than immediate for 'both' 13:03:10 I tried to use it - but ... guess there's no 'but', thought for some reason that I wasn't able to use it here :[ 13:03:37 ah 13:04:41 if I'd use create, would 'both' not require some kind of 'name' ? 13:04:58 Yeah, I'm just experimenting with it at the moment 13:06:20 GeDaMo, thanks - I'm just playing around myself, so if it's too much effort, there's no need to waste your time :) 13:06:31 No problem :P 13:12:40 : both: create ' , does> @ tuck execute >r execute r> ; both: simple square 13:13:45 benny99: 13:14:02 GeDaMo, thanks :) 13:15:08 GeDaMo, oh, I didn't mean to use the return stack btw. :-[ - or is that the smarter way ? 13:15:30 Is there some particular reason to not use it? 13:15:59 no 13:16:40 It can help reduce some of the stack juggling 13:17:42 'interpreting a compile-only word' on 'both: simple square >>>;<<<' -- hm 13:17:58 GeDaMo, so it's probably a smarter definition :p 13:18:15 You don't need a ; on the end of that 13:18:39 ah, of course :-[ 13:19:52 I useually put a : on the end of words which read from the input stream, since this reads two I should have called it 'both::' :P 13:23:12 GeDaMo, well, if you think of it as a "yes/no-definition" it remains correct :p 13:24:43 Yeah, true, it's only defining one word 13:29:22 GeDaMo, though it's still not possible to use 'both' 'anonymously' or is it :[ ? 13:30:33 In what way? 13:31:36 You could define : both ( a b xt -- a' b' ) tuck execute >r execute r> ; 13:31:36 : test 5 6 both square ; 13:32:23 GeDaMo, yeah, but 'data' both 'what' just looks better for me :[ 13:32:45 It's not very Forth-like though :P 13:33:03 I'm just toying around, trying to find out whether that is possible 13:33:17 GeDaMo, but it saves a tick everytime I use it :p 13:35:21 and I still wonder why my original definition did not work -- both uses square in simple immediately and test uses simple immediately, don't they ? 13:37:47 Did it fail during the definition of simple? 13:37:59 '2 3 both square .s 2drop' --> '<2> 4 9' ... but '2 3 simple' --> '<2> 2 3' 13:38:09 GeDaMo, no 13:38:14 (using gforth btw.) 13:38:18 Me too 13:39:23 Think about what happens when you define simple in your original code 13:39:52 'both' executes in the middle of defining it 13:40:08 yeah 13:40:15 it parses square out of the input strem then runs it on what is on top of the stack at that time 13:40:24 so geforth should give me some warning/error because the stack is empty 13:40:45 It probably isn't empty - there will be values related to the compilation 13:41:27 ah 13:44:04 : [both] ' postpone literal ['] both compile, ; immediate 13:44:33 benny99: 13:48:52 GeDaMo, hm, not here, though I'm not using the return stack, but it should work anyway hm ? 13:49:35 ? 13:50:08 The 'both' in that is my definition : both ( a b xt -- a' b' ) tuck execute >r execute r> ; 13:52:09 mine is ': both ' tuck execute -rot execute swap ;' --- but ' will still read from the input stream hm ? 13:52:16 http://forth.pastebin.ca/1418609 13:53:10 (tick tuck ... maybe it's missing 'tack' for aesthetics ?) 13:56:26 http://forth.pastebin.ca/1418613 <-- found the difference, hmk 13:57:54 I think you have an extra tick in there 13:58:38 GeDaMo, yeah 13:59:06 --- quit: kar8nga (Remote closed the connection) 13:59:10 GeDaMo, but if I remove that extra tick, '2 3 both square' becomes invalid 14:00:00 You want to use the same word for interpreting and compiling? 14:00:04 GeDaMo, but I should be able to 'end that story' myself :-[ 14:00:54 GeDaMo, no, not necessarily 14:13:04 guess I still don't really comprehend what immediate, postpone, [ ... ], compile, -- etc. are doing :/ 14:15:02 postpone parses the name of an immediate word out of the input stream and compiles it into the current definition 14:16:14 that's what I read at http://www.delorie.com/gnu/docs/gforth/gforth_49.html also -- but ' postpone literal <-- what ? 14:16:36 Normally 'literal' would execute at compile time 14:16:44 Because it's an immediate word 14:17:18 'postpone literal' means "don't execute this now" 14:17:27 yeah 14:18:07 compile, compiles an xt into the current definition 14:18:43 * benny99 looks up literal 14:19:01 literal compiles a literal value into the current definition 14:19:56 Normally, you would use it like : twenty-five [ 5 5 * ] literal ; 14:20:02 ah ... and since ' gives a xt, that is compiled and later invoked ? 14:20:21 Using [ and ] like that switches out of and back into compilation mode 14:20:26 yep 14:21:00 Not invoked, just pushed onto the stack 14:21:06 I know what those words are supposed to do I guess, but I don't really know how to use them 14:23:10 Understanding interpret, compile and run-time is important 14:23:38 GeDaMo, sorry for 'teasing' you :[ - step by step: 1) ' -> get next word from input stream (i.e. square) 2) postpone literal - execute literal later and push ?what? on the stack? 14:23:59 GeDaMo, oh dear, interpret and run-time are different :( ? 14:24:04 ' gets the xt 14:24:13 GeDaMo, yeah, gets the xt 14:24:27 but what does postpone literal do then with what ? 14:24:33 postpone literal compiles that number so at run-time the xt will be pushed onto the stack 14:25:44 Have you looked at the ANS Forth standard? 14:25:46 ah ... the xt-number ? 14:25:52 Yes 14:26:07 GeDaMo, I use the gforth-manual immo 14:26:50 The standard specifies when a word has different interpret, compile and run-time behaviours 14:27:34 3) ['] both -> get xt of both 'now' 4) compile, -> compiles that into the word that invokes [both] ? 14:27:55 Yes 14:28:25 Try typing "see test" 14:29:30 ah, of course -- but that would have bothered you less I guess :[ ... thanks 14:29:45 :P 14:30:02 If you do ' square . 14:30:04 that really helped me a lot :) 14:30:12 The number printed should be the same as the one in test 14:30:24 Because that's its xt 14:30:27 it is :) 14:34:37 * benny99 feels like he just learned a lot 14:35:03 It's nice when things seem to fall into place :P 14:35:13 oh yeah :) 14:46:18 benny99: you can replace "['] both compile," with "[compile] both" 14:47:56 Hmmm ... ok, you can't 14:47:58 GeDaMo, looks even better :) - btw. - I renamed your 'both' to 'bothexec' and replaced it by ': both ' bothexec' - now everybody is happy :p 14:48:06 GeDaMo, I can ._. 14:48:08 --- join: Al2O3 (n=Al2O3@24.9.43.112) joined #forth 14:48:20 I must be doing something wrong then :P 14:48:27 sorry, I can't 14:48:30 loaded the wrong file 14:49:09 * benny99 just wrote 'loaded' ... 14:52:33 compile, -- Append the execution semantics of the definition represented by xt to the execution semantics of the current definition. ---- [compile] -- If name has other than default compilation semantics, append them to the current definition; otherwise append the execution semantics of name. An ambiguous condition exists if name is not found. 14:53:59 I think [compile] is just the same as postpone - which is not what we want in this case 14:54:33 You'll have to stick with ['] both compile, 14:55:39 Or you could do s" both" evaluate 15:00:13 D'oh! You can do "postpone both" 15:06:57 indeed :) 15:11:31 benny99: I'm off to bed 15:11:39 Good luck with your exploration :) 15:11:41 GeDaMo, me too :) 15:11:42 thanks again ! 15:11:49 * benny99 will explore more tomorrow 15:11:55 :) 15:12:00 --- quit: GeDaMo ("Leaving.") 15:36:46 --- quit: benny99 ("Leaving") 17:16:39 Hmm...missed them. Well, I'll say it anyway. [compile] and postpone are not actually the same ... for historical reasons, `[compile] normal-word` is a no-op, whereas `postpone normal-word` is not. 18:02:32 --- join: nighty^ (n=nighty@210.188.173.245) joined #forth 18:03:57 --- join: andrewSC (n=andrew@ipanema.parkpointrit.com) joined #forth 18:04:09 hi all 18:04:10 :) 18:12:32 hey 18:14:58 :3 18:15:14 how goes it? 18:15:23 well! 18:15:25 yourself? 18:17:16 not too bad 18:17:25 *badly, even 18:17:33 mhmm 18:27:04 man i feel like programming 18:27:05 :) 18:36:07 --- quit: malyn ("Disconnecting from stoned server.") 18:39:17 --- join: malyn (n=malyn@unaffiliated/malyn) joined #forth 19:08:16 --- quit: andrewSC ("Leaving") 19:31:38 --- quit: aguai (Read error: 104 (Connection reset by peer)) 19:32:08 everybody watching 19:32:11 that don't mean you stoppin 20:00:10 --- quit: Al2O3 ("I'm heading out, will be back online soon") 20:31:01 --- quit: malyn ("Disconnecting from stoned server.") 20:32:53 --- join: malyn (n=malyn@unaffiliated/malyn) joined #forth 21:24:21 --- quit: chinese ("ÔÝÀë") 21:24:25 --- join: chinese (n=yoyo@117.22.133.239) joined #forth 21:27:46 --- quit: chinese (Client Quit) 21:53:23 --- quit: tathi (Read error: 145 (Connection timed out)) 22:38:56 --- quit: dkcl ("leaving") 22:39:08 --- join: dkcl (n=dkcl@unaffiliated/dkcl) joined #forth 23:59:59 --- log: ended forth/09.05.10