00:00:00 --- log: started forth/15.02.04 00:05:28 --- join: fantazo (~fantazo@089144195084.atnat0004.highway.a1.net) joined #forth 00:11:57 --- quit: Anarch (Ping timeout: 264 seconds) 00:40:00 --- quit: tangentstorm (Quit: WeeChat 0.3.2) 00:40:17 --- join: tangentstorm (~michal@108-218-151-22.lightspeed.rcsntx.sbcglobal.net) joined #forth 00:54:21 --- quit: fantazo (Ping timeout: 245 seconds) 00:55:52 --- join: fantazo (~fantazo@089144195084.atnat0004.highway.a1.net) joined #forth 01:43:13 --- quit: fantazo (Ping timeout: 250 seconds) 01:45:17 --- join: fantazo (~fantazo@089144195084.atnat0004.highway.a1.net) joined #forth 01:54:53 --- join: true-grue_ (~grue@95-27-156-52.broadband.corbina.ru) joined #forth 01:57:34 --- quit: true-grue (Ping timeout: 264 seconds) 04:23:14 --- quit: proteusguy (*.net *.split) 04:23:14 --- quit: malyn_ (*.net *.split) 04:23:15 --- quit: DKordic (*.net *.split) 04:23:41 --- join: malyn_ (~malyn@unaffiliated/malyn) joined #forth 04:30:19 --- join: proteusguy (~proteusgu@183.89.209.51) joined #forth 04:30:19 --- mode: ChanServ set +v proteusguy 04:31:05 --- join: DKordic (~user@79-101-227-130.dynamic.isp.telekom.rs) joined #forth 04:56:43 --- join: nighty^ (~nighty@hokuriku.rural-networks.com) joined #forth 05:05:13 --- quit: protist (Quit: Konversation terminated!) 05:07:03 --- quit: xyh (Remote host closed the connection) 05:09:14 --- quit: true-grue_ (Read error: Connection reset by peer) 05:10:11 --- join: true-grue (~grue@95-27-156-52.broadband.corbina.ru) joined #forth 05:26:26 --- join: Zarutian (~Adium@168-110-22-46.fiber.hringdu.is) joined #forth 05:37:26 --- quit: true-grue (Read error: Connection reset by peer) 05:38:56 --- join: true-grue (~grue@95-27-156-52.broadband.corbina.ru) joined #forth 05:40:46 --- quit: true-grue (Read error: Connection reset by peer) 06:38:20 --- quit: denysonique (Ping timeout: 250 seconds) 06:47:19 --- quit: nighty^_ (Ping timeout: 276 seconds) 06:48:16 --- join: nighty^_ (~nighty@68.179.124.161) joined #forth 06:50:26 --- join: true-grue (~grue@95-27-156-52.broadband.corbina.ru) joined #forth 06:55:14 --- quit: nighty^_ (Ping timeout: 250 seconds) 06:55:53 --- join: nighty^_ (~nighty@68.179.124.161) joined #forth 07:02:57 --- join: denysonique (~quassel@31.55.77.74) joined #forth 07:02:57 --- quit: denysonique (Changing host) 07:02:57 --- join: denysonique (~quassel@unaffiliated/dennisonicc) joined #forth 07:03:03 --- quit: nighty^_ (Ping timeout: 265 seconds) 07:03:25 --- join: nighty^_ (~nighty@68.179.124.161) joined #forth 07:15:20 --- quit: darkf (Quit: Leaving) 07:19:48 --- quit: nighty^_ (Ping timeout: 252 seconds) 07:20:46 --- join: nighty^_ (~nighty@68.179.124.161) joined #forth 07:33:49 --- join: xyh (~xieyuheng@222.58.77.55) joined #forth 08:16:13 --- join: I440r (~mark4@38.122.200.194) joined #forth 08:16:19 --- mode: ChanServ set +o I440r 08:31:27 --- quit: proteusguy (Remote host closed the connection) 08:57:28 --- join: proteusguy (~proteusgu@ppp-110-168-229-159.revip5.asianet.co.th) joined #forth 08:57:28 --- mode: ChanServ set +v proteusguy 08:59:01 --- quit: Zarutian (Quit: Leaving.) 09:02:52 --- quit: true-grue (Read error: Connection reset by peer) 09:04:39 --- join: true-grue (~grue@95-27-156-52.broadband.corbina.ru) joined #forth 09:31:11 --- join: Zarutian (~Adium@168-110-22-46.fiber.hringdu.is) joined #forth 09:32:21 --- quit: xyh (Remote host closed the connection) 09:49:37 --- join: xyh (~xieyuheng@222.58.77.55) joined #forth 10:14:41 --- join: bedah (~bedah@g228251137.adsl.alicedsl.de) joined #forth 10:21:57 --- quit: xyh (Remote host closed the connection) 11:04:55 --- quit: denysonique (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) 11:32:27 --- quit: Zarutian (Ping timeout: 252 seconds) 11:33:10 --- join: Mat4 (~claude@ip18861915.dynamic.kabel-deutschland.de) joined #forth 11:33:13 hello 11:47:12 --- join: denysonique (~quassel@31.55.77.74) joined #forth 11:47:13 --- quit: denysonique (Changing host) 11:47:13 --- join: denysonique (~quassel@unaffiliated/dennisonicc) joined #forth 12:04:19 --- join: chouser (~chouser@c-68-59-170-128.hsd1.fl.comcast.net) joined #forth 12:05:55 greetings forth gurus. I'm am sinking in a sea of compilation semantics in the interpreter, or perhaps vice-versa 12:06:48 I have a normal :-defined word extend-method* that can be used like this: ' pr-str :noname 42 ; extend-method* 12:07:10 shoot, that's wrong. Going again: ObjList ' pr-str :noname 42 ; extend-method* 12:07:35 That is, it takes ( obj xt1 xt2 -- obj ) 12:08:38 I would like to define a tricky special parsing word so that I can achieve the same behavior by writing: ObjList extend-method pr-str 42 ; 12:10:01 that is, extend-method would expect to find obj on the stack, then parses pr-str to look up xt1, then compiles to the next ; to produce xt2, and finally calls extend-method* 12:10:47 I think I've got the first two stack entries sorted out. The first just sits there, so it's fine. 12:11:04 For the second, I did this: parse-name find-name name>int 12:11:33 so now I just need to compile to the next ; and produce an xt, but I'm stumped. 12:12:25 Any suggestions? Some combination of ":noname", "postpone", maybe "compile,"? 12:12:56 well im not sure if OOP would help forth and im not an ANS forth guru 12:13:21 i would have to understand how the OOP had been implemented 12:13:51 I440r: you're talking to me? feel free to ignore the word "method" in there everywhere 12:13:58 lol 12:14:02 :-) 12:14:06 it still looked like oop lol 12:14:12 its not oop? 12:14:21 well, it is, but it's my own thing, and I agree it may not help 12:14:27 but that's beside the point :-) 12:14:33 of course lol 12:14:39 we do these things not because they are easy... 12:14:48 im not a fan of noname: 12:15:10 I just want to define a word that can be used to compile the input stream to the next ; and drop an xt on the stack. 12:15:21 i dont do ans forth. my forths use a different mechanism to create headerless words 12:15:42 I440r: ah, ok, I'm open to any other way to package up some compiled code 12:15:53 I'm using gforth because, well, it's there. 12:15:53 ok so you basically want to be able to do : blah ... ... ...; and at the ; you have an XT on the stack 12:16:18 close, and maybe close enough. 12:16:41 : ;' [compile] ; last name> ; immediate 12:16:43 I want to do : blah ... ; and have blah get the xt and the squirrel it away somewhere 12:16:56 oh blah returns its own XT ? 12:17:10 erm at run time or at compile time? 12:17:33 no, blah is storing bits of code here and there in memory. blah is used at the top level, so it's "runtime" is sorta the programs compile time, if that makes sense. 12:17:45 s/it's/its/ 12:17:51 no that makes sense 12:18:04 but maybe you wanta create does> word instead? 12:18:13 you know how to use create does> ? 12:18:16 ok, I'm staring at your magic incantation. Is that a definition of ; 12:18:45 its a wrapper for ; that ticks the word that was created and leaves its xt on the stack (sort of it doesnt use ' ) 12:18:54 I barely know any of this. I did manage to use create does> to do what I wanted elsewhere... 12:18:56 : blah ... ... ;' 12:19:07 ( --- cfa-of-blah ) 12:19:44 : constant create , does> @ ; <--- thats a good example of a simle use of create does> 12:19:52 if you then do 123 constant foobar 12:20:14 executing the creation of foobar COMMAS in the 123. the execution of foobar jumps to the code after does> 12:20:24 right. I think I grasp uses of create does> that are not more complicated than that. 12:20:34 the address of the body of foobar will be on the stack so the @ fetches that constants body 12:20:54 a GOOD forth programmer does not get much more complificated than that :) 12:21:08 ooh, maybe ... my does> could take the xp and squirrel it away 12:21:09 do you understand [compile] and compile <-- two different words 12:21:16 i do not ever use "postpone" i hate that word 12:21:34 but the does> part only happens at RUN time 12:21:48 run time of the word that was created. not run time of the word doing the creating 12:21:49 ...but how do I get the create block to cause the input stream up through ; to be compiled? it's not like I can leave :noname on the stack... 12:22:17 chouser, you dont want i to, just let forth compile all that stuff as usual 12:22:17 no, I definitely do not understand [compile] or compile or compile, 12:22:37 i dont know what compile, is 12:22:47 but compile and [compile] i understand 12:22:56 hm, ok. 12:22:58 so 12:23:11 lets assume that your forth just compiles addresses inside colon definitions 12:23:31 so : foo bar bam ; compiles a word called foo that has the address of bar and the address of bam at its body 12:23:55 because those are the compilation semantics of normal words. 12:23:57 so when you do something like : foo compile bar ; the word foo has the address of compile and the address of foo 12:24:09 and the address of bar i mean 12:24:21 so when FOO executes BAR is compiled to "here" 12:24:41 lets do this 12:24:46 : foo compile bar ; immediate 12:24:56 : blah xxx yyy zzz foo ; 12:25:02 that would literally be the same as doing 12:25:08 : blah xx yyy zzz bar ; 12:25:16 because foo would execute and compile bar 12:25:21 thats how "compile" works 12:25:37 ok, I think I see. 12:25:42 compile takes the next token out of the execution stream and compiles it 12:25:42 compile is a parsing word? 12:25:45 ok 12:25:50 no 12:25:58 do you code assembler ? 12:26:01 even just a little? 12:26:06 ha! once, long ago. 12:26:11 ok thats good enoug 12:26:11 z80, I think 12:26:22 lets recode foo in assembler sort of 12:26:25 code foo 12:26:32 call nest ; run a colon definition 12:26:40 .int compile 12:26:42 .int bar 12:26:46 .int exit 12:26:56 the ; compiles the exit on the end of the colon definition 12:27:07 hm, ok 12:27:13 so. when you RUN foo forths IP (interpretive pointer) points to compile 12:27:29 it does a fetch and jumps to compile. when compile runs IP is now pointing at foo 12:27:47 compile fetches the next XT (the address of foo) and advances IP to the exit 12:27:54 compile then COMPILES the xt it just fetches 12:27:56 fetched 12:28:06 ok, I think I get it. When I said "parsing word" I just meant that it parses the next word of the input stream to know what token its compiling. 12:28:15 this happens as foo executes. : foo compile bar ; <- no parsing required 12:28:42 right thas what a parsing word is, it parses the INPUT stream. in this case compile is SORT of a parsing word but it parses the execution stream 12:28:45 understand the difference? 12:29:12 when the above "compile" runs the foo isnt a "foo" string, its a 0x12345 <-- some address 12:29:22 compile fetches that addresss and writes it to HERE 12:29:27 you know what here is yes? 12:29:48 wow, ok, I see the difference. 12:30:04 [coompile] on the other hand IS a parsing word, it parses the input stream 12:30:11 hers what [compile] is used for 12:30:19 in my above code i did [compile] ; 12:30:33 yes, just. HERE returns a pointer on the same stack where ALLOT advances 12:30:37 why? because semi is an immediat word. so is [compile] btw 12:30:55 chouser exectly. here is where "whatever gets compiled next gets compiled to" 12:31:13 so. [compile] parses the INPUT stream and... compiles it 12:31:37 just one word though? 12:31:45 if because ; is an immediate word if you just did : blah ... .... ; ... ... ; <-- the first semicolon would terminate the definition 12:31:54 yes just one space delimited token 12:32:55 : ;' [compile] ; last name> ; immediate 12:33:04 the asm for this word would be 12:33:09 code ;' 12:33:16 int semi 12:33:20 int last 12:33:23 int name> 12:33:25 int exit 12:33:42 because the [compile] parsed the next token and compiled it 12:34:06 [compile] is used to COMPILE an immediat word. if you didnt use [compile] then forth would execute the ; not compile it 12:34:35 ok, so what does this buy me? You're not saying I should use ;' right? You think I need to write something similar? 12:34:48 the ans word "postpone" which i froth at the mouth over does the job of BOTH of these words 12:34:58 ah, I see. 12:35:14 well what ;' would do is return the address of the word that it terminated 12:35:36 im not 100% sure of what you are trying to do, i dont know that this is helpful to you 12:36:03 and your using an ans forth and i HATE ans forth (/froth-at-mouth) 12:36:48 I'm using gforth. It appears to support [compile]. What do you prefer? 12:37:14 If I get it right, people prefer their forth 12:37:15 well the reason ans forth has postpone is because you dont know what words are and what words are not immediate 12:37:33 gabc: :-) 12:37:56 when you have seen one forth you have seenone forth 12:38:03 i much prefer my own forths 12:38:24 the ones you've written, you mean? 12:38:26 chouser: In the same way Moore see it, I guess 12:38:36 yes 12:39:19 [compile] and compile are in the ans spec. postpone last i looked is not 12:39:34 yet ans forth fanboys all use postpone 12:39:57 im a non ans forth fanboy :P 12:40:55 Hehe 12:41:32 Yes, that your stance on ans is much clearer than the implementation of, say, : 12:41:37 :-) 12:41:55 ok, well, maybe I'm just fighting the wrong battle. If I relax my requirements a bit... 12:42:08 'postpone' is symptomatic in my opinion 12:42:16 --- quit: fantazo (Quit: Verlassend) 12:42:25 symtomatic of what 12:42:54 bad design choices 12:43:03 its a symptom of the ans standards team trying to achieve something that cannot ever be achieved in any language ever. PERIOD 12:43:06 i.e. portability 12:43:17 I've got this working: ObjList :noname 42 ; extend-method pr-str 12:43:35 I was hoping users of extend-method wouldn't have to say ":noname" 12:43:40 the extend-method takes the address right? 12:44:16 extend-method needs the xt so it can pass it to extend-method* 12:44:24 right 12:44:29 maybe I should have cleaned up these names a bit before asking my questions. :-) 12:44:48 it seems to me like your trying to implement something similar to the quit loop INSIDE the quit loop 12:44:50 I440r: to be honest, ANS forth is in some way a success on that aspect 12:45:34 Mat4, which is why every ANS forth source file i have ever seen that claims to be portable has #ifdefined iforth... #endif #ifdefined swiftforth ... #endif .... ad infinitum 12:45:58 i.e. the same clusterfuck of conditional compilation that plagues the C language 12:51:38 that's right. ANS forth features the same philosophy for platform independence and as such is successful in the same way 12:52:24 (with the same range of limitations and problems) 12:53:47 developing embedded applications in C is like opening a can... with a rock 12:53:52 -- Ron Oliver -- 12:54:00 a good friend of mine and a forth master coder 12:54:31 who also hosts www.isforth.com for me on one of his machines which is situated in the building owned by forth inc lol 12:54:43 still need to reactivate that domain tho 13:00:04 I440r: that's for walking me through that. I think what I wanted didn't quite make sense, and I have a completely usable alternative now. 13:00:35 even if it isnt what you were looking for you learned a little :))) 13:00:48 you think you understand compile and [compile] now? 13:02:10 Yes, I think so. 13:02:33 Thanks. 13:58:46 --- quit: true-grue (Read error: Connection reset by peer) 14:13:34 chouser: in general, you can simply ignore what I440r writes, he's close to luddites in his opinions. 14:13:48 chouser: in particular "postpone" works better than "[compile]". 14:14:04 You seem to use gforth, and there it definitely works in a different way. 14:14:07 as opposed to someone whose every comment is pure unadulterated Forth hate. i reserve my derrision for ans forth :P 14:15:12 So I had a fair solution, and then with more thought I realized it wasn't just the initial word (like :noname) that I was wanting to emulate/change, it was the terminator ; as well. 14:15:23 ...as inspired by I440r's '; 14:16:14 So now my foo ends with :noname, and I defined a ;; that starts with "[compile] ;" and it works rather nicely! 14:16:29 chouser, to a degree asau is right, but for the most part his MO is to say everything he can to discourage anyone from using or learning anything about forth 14:16:31 It looks lie you want to learn about >in. 14:16:40 I don't think I can use postpone ; to get what I want. 14:17:03 You don't seem to. 14:17:07 ASau: that seems possible as well, though parse-name may have been all I needed on that front, I'm not sure. 14:17:50 Your "extend-method" seems to embed ":noname". 14:18:00 yes 14:18:30 What you probably want is to intercept ";" by defining your own ";" in additional wordlist 14:18:42 and running your code after the real ";". 14:18:50 ohhh, I had read about additional wordlists, but then forgot. 14:18:52 i gave him on possible reimplementation for ; 14:19:33 but i think he is over thinking it still, i need to understand what the noname methods do. im guessing the method is a template and invoking it is instantiating it 14:19:44 basically thats what a : definition is 14:20:18 im not quite seeing what he is trying to do... 14:20:54 i think a create does> word would work for what he is trying to do but... im not sure 14:21:56 I'll post my whole file (work in progress) later tonight, and then you're all welcome to rip it to shreds. :-) 14:22:31 nobody will rip it to shreads 14:22:50 thats like "you can shoot me down and treat me like an idiot" thats not what we do here :P 14:25:50 hm, I think redefining ; via a word-list, while cute, would cause problems if anyone needed to nest another definition inside. 14:26:02 Better not try to be so clever, I think. 14:27:48 you shouldnt redefine ; unless your redefinition is within its own vocabulary (word list?) 14:27:57 and not normally visible 14:29:32 right, but even in that case I think it would hurt composibility 14:29:59 as an example of this you have the forth word "and" but you also have the assembler mnemonic "and" in the assembler vocabulary 14:30:04 no conflict 14:30:40 foo ... ; \ foo could temporarily define ; in a new word list to be something that would remove itself from the search order when encountered 14:31:13 ..but that would not be what was wanted if: foo ... :noname sub-thing ; ... ; 14:32:33 --- quit: nighty^ (Quit: Disappears in a puff of smoke) 15:08:31 --- quit: denysonique (Ping timeout: 244 seconds) 15:20:11 --- join: denysonique (~quassel@unaffiliated/dennisonicc) joined #forth 16:00:59 --- quit: I440r (Quit: Leaving) 16:04:48 --- quit: bedah (Quit: Ex-Chat) 16:15:43 --- quit: Mat4 (Quit: Verlassend) 16:54:39 --- join: nighty^ (~nighty@68.179.124.161) joined #forth 16:56:24 --- quit: nighty^_ (Ping timeout: 245 seconds) 17:23:42 --- quit: denysonique (Ping timeout: 265 seconds) 17:27:34 --- join: denysonique (~quassel@31.55.77.74) joined #forth 17:27:34 --- quit: denysonique (Changing host) 17:27:34 --- join: denysonique (~quassel@unaffiliated/dennisonicc) joined #forth 18:06:52 --- join: darkf (~darkf___@unaffiliated/darkf) joined #forth 18:11:35 --- quit: chouser (Ping timeout: 250 seconds) 18:31:52 --- join: chouser (~chouser@c-68-59-170-128.hsd1.fl.comcast.net) joined #forth 18:55:50 Here's what I've got as a solution for the problem I posed earlier: https://github.com/Chouser/mal/blob/8e56b76e44bb86e685d0af57ff814f954f4f3efa/forth/types.fs#L245 19:29:58 --- quit: denysonique (Ping timeout: 244 seconds) 19:44:26 --- quit: chouser (Ping timeout: 264 seconds) 20:42:25 --- quit: proteusguy (Remote host closed the connection) 21:00:04 --- join: gabriel_laddel (~user@unaffiliated/gabriel-laddel/x-9909917) joined #forth 21:02:39 --- quit: gabriel_laddel (Remote host closed the connection) 21:03:42 --- join: proteusguy (~proteusgu@183.89.208.107) joined #forth 21:03:42 --- mode: ChanServ set +v proteusguy 21:08:05 --- quit: proteusguy (Ping timeout: 245 seconds) 21:19:05 --- join: gabriel_laddel (~user@unaffiliated/gabriel-laddel/x-9909917) joined #forth 21:24:18 --- join: darkf_ (~darkf___@unaffiliated/darkf) joined #forth 21:27:21 --- quit: darkf (Ping timeout: 245 seconds) 21:31:16 --- nick: darkf_ -> darkf 21:56:26 --- join: MrMobius (~Joey@c-68-45-16-225.hsd1.nj.comcast.net) joined #forth 23:37:32 --- quit: joneshf-laptop (Remote host closed the connection) 23:37:51 --- join: joneshf-laptop (~joneshf@98.208.35.89) joined #forth 23:59:59 --- log: ended forth/15.02.04