00:00:00 --- log: started retro/12.08.04 05:15:34 --- join: salvager_ (cc6fab08@gateway/web/freenode/ip.204.111.171.8) joined #retro 05:16:07 Hello everyone 05:16:09 Good Morning 05:17:59 I have a doubt about a retro command,i was wondering if you guys can clear it :) 05:25:08 ask :) 05:26:58 I have just started learning retro and i am reading this doc (http://retroforth.org/docs/An_Introduction_to_Retro.html) right now 05:27:22 I am trying to execute this command ': scale ( x-y ) a @ * ;' as a part of example in the doc 05:28:03 The moment i type ': scale ( x-y) a' it asks me 'a ?' 05:28:11 I type '1000 variable: a' 05:28:18 but it still asks 'a ?' 05:28:27 Am i doing anything wrong ? 05:28:53 no; the first two lines in that section should have been removed 05:29:09 the a ? means retro can't find a word or variable named a in the dictionary 05:29:45 yes, so shouldnt '1000 variable: a' define 'a' ? 05:29:59 yes, as long as you ended the previous definition first 05:30:18 oh, but it doesnt let me end the previous definition 05:30:26 ; 05:30:45 when it says a ?, just hit ; and a space to terminate the bad definition 05:31:15 Yes, i am doing that to terminate the definition 05:31:52 So, should i define 'a' first and then define the expression ? 05:32:00 yes 05:32:35 retro: 03crc  * rcrc@questor-20120804123203-mt7xsrn1y8apwtjh 10rx/ (3 files in 2 dirs): fix example in hyperstatic global environment section of introductory text 05:34:20 Thank you, i have another question if you dont mind ... 05:35:42 should i use ': 1000 variable: a' to define the variable ...without the ':' it wont let me type the whole definition ..the whitespace escapes the definition of the expression 05:35:59 no, variables are not defined using : 05:36:58 When i try something like this '1000 variable: a' the listener wont let me type after '1000' it goes to a new line 05:37:20 that's ok 05:38:30 it's a side effect of how the interpreter was designed 05:38:52 it starts a new line after each token is processed 05:39:17 yes, so when i type '1000' it saves the number in the stack 05:40:19 Then, how can variables be created when new lines comes after processing each token ? 05:41:33 Sorry, i was little confused with the interpreter .. I might be spamming this chat room :) 05:41:40 the newlines are a display issue only 05:41:44 1000 05:41:49 value goes on the stack 05:41:51 variable: a 05:42:06 pulls the 1000 off the stack, makes 'a', and sets its value to 1000 05:42:25 when i type 'variable: a' it goes to new line after 'variable:' 05:42:50 that shouldn't happen 05:42:55 which retro version? 05:43:11 new one 11.4 05:43:16 let me try again 05:43:50 the first two commands worked, 05:44:09 which command should i use, to print the value of variable ? 05:44:17 a @ putn 05:45:20 yes it worked, thank you for update in documentation 05:45:58 no problem; sorry for the confusion 05:46:17 i realized that i should not worry about new lines created after each token. I should go on and type the full expression :) 05:47:09 The example in the docs looked like it was typed in the interpreter, so i was trying to type the same thing and i got confused when i did not see the same output as the example doc 05:48:04 I'll clarify this in the docs soon 05:48:26 (I'm at work currently, so time is limited until this evening) 05:48:49 No problem, thanks for the quick updates and clarifying my doubt 05:48:53 Retro looks like fun 05:48:54 :) 05:49:22 Have a good day, i might spam this IRC if i have more questions but i will try to understand and not to post too many doubts 05:49:55 feel free to ask. it may take a while for me to answer, but I'll do my best to help 05:51:05 --- nick: tangentstorm-afk -> tangentstorm 05:51:30 Thank you, i will be working with this more over next 2 days :) 07:53:25 --- quit: salvager_ (Quit: Page closed) 10:04:13 --- nick: tangentstorm -> tangentstorm-awa 10:06:23 --- join: salvager_ (cc6fab08@gateway/web/freenode/ip.204.111.171.8) joined #retro 10:07:34 Hi crc, i am trying to use console in retroforth 10:07:51 when i type the command needs console' it shows me all the documentation 10:09:14 but when i type (console' red) or (console' onRed) or (: console onRed) it does not work 10:28:18 I have got the commands working like this 10:28:35 ^console'(use the appropriate function here ) 10:32:43 but still doing a command like ^console'onRed is not changing anything 10:38:38 --- join: impomatic (~digital_w@31.185.139.168) joined #retro 12:31:19 --- nick: tangentstorm-awa -> tangentstorm 13:07:24 the documentation will show, since it's embedded in the source 13:07:34 use either: with console' 13:07:43 (to add it to the search order) 13:07:54 or ^console' 13:08:28 if you enter console' directly, it'll replace the default dictionary 13:09:30 * crc is going to move to a flat dictionary in retro12; the search order bits are becoming annoying to me 13:09:46 heya @crc :) 13:09:52 hi tangentstorm 13:09:55 flat is nice 13:10:53 I've been doing a flat dictionary in parable (my other language project) and finding it cleaner overall 13:11:16 is there currently a dictionary stack (or search list)? 13:11:38 there's a search list 13:11:50 i'm still just reading docs at the language level.. i haven't found this yet... i know "words" shows the global words... but how do i see the list of modules, and the list of words in the modules... and how do i see the definition of a word? :) 13:12:22 words ending in a ' are vocabularies 13:12:34 add them to the search order, then do words to see what's in them 13:12:43 with "need" ? 13:13:00 hrm 13:13:03 needs vocabulary' 13:13:10 will load the vocabulary from the library 13:13:13 with vocabulary' 13:13:18 adds it to the search order 13:13:34 and without removes the last one? 13:13:35 without removes the last one added from the search order 13:13:37 yes 13:13:49 and global returns to just the main dictionary 13:15:49 so... : showvoc ..... and i'm stuck. i can't define what i want to define without quoting the words "needs" 13:16:43 so now i want to go quote the word needs... and i have to find the word for quote... and showvoc is the tool i was hoping would help me with that :D 13:18:38 not trying to whine and complain... the answer is RTFM ... but I'm thinking there ought to be a word like "help" that gives this basic "how to explore" information up front 13:21:49 : showContentsOf ' .chain words "%%" find drop @d->xt do ; 13:21:55 it's frustrating, because i can see the steps in my head to define showvoc... take a name, "need" it, "with" it, list the words that are new.. and pop it, unless it was already in the old list 13:21:56 showContentsOf console' 13:22:22 you'd still need to load the vocabulary with needs first though 13:23:01 yeah.. so to me it's "dup needs with ... output result ... without" 13:23:54 i don't care that the words are new.. that's part of the fun... it's that i don't know how to find them with out searching through the manual 13:24:17 there's not any method currently 13:24:47 yeah, but you're showing me how to make one right now :) 13:26:08 so.. okay... i see this code, and i probably should have known ' from ans forth... but then i see .chain and wonder what it means 13:26:22 closest i had was that see command that moved off into casket 13:26:50 is there another way to see the definition? 13:29:14 the only decompilers are in examples/autopsy.rx; they use one of the libraries IIRC 13:29:35 .chain is the class handler for vocabularies 13:36:06 http://sprunge.us/CcNg 13:36:21 that's a pretty minimal decompiler using the dissect' library 13:36:34 thanks 13:37:00 no problem 13:37:01 my brain's just churning here trying to catch up with you :) 13:37:52 i see the debugger in autopsy.rx... very cool.. i added an external one to the pascal vm implementation too 13:39:11 ok ... one more question.. i type words and there are lots of words! :D 13:39:35 what's retro for: ls | grep "foo" 13:40:44 no equivilent to ls; there's a crude grep for files in examples/util 13:41:52 sorry.. in python i can say dir() to list defined variables... and [ word for word in dir() if word.startswith("x") ] 13:42:06 like.. just how do i filter the output of "words" so i can find the needle in the haystack? 13:42:46 $G 1% N: 2 F: ( N. F. \ 0 > ^ F. 1 + F: ) F. N. < [ F. ! "" #G, N. F. /;] @ 13:42:51 Prime factors in Mouse! 13:43:47 @crc : like in the /demo/ page, if i type "words"... i don't see ANY words whose names end with "'"... because they scrolled off the screen 13:44:20 oh not true there's d' and ' :) 13:44:52 and --' ... it's like a word search :D 13:45:21 __' i guess 13:45:32 hmm, this will involve some thinking 13:47:04 Wrong channel, sorry. In case you're wondering Mouse is a 70's RPN stack based language http://en.wikipedia.org/wiki/Mouse_(programming_language) 13:47:08 ... the name of the word isn't in the record that contains its definition, is it? 13:47:33 impomatic : looked pretty forthy to me. i wouldn't have known. :) 13:47:51 the name is in the dictionary, which has the pointers to the definitions 13:48:25 a minimalistic words would be: : words last [ d->name puts space ] ^types'LIST each@ ; 13:48:42 (though that doesn't track search order, only the global dictionary) 13:49:07 the dictionary is like a python dictionary then? like a hash? 13:49:11 hashmap? 13:50:47 ok. now it makes sense why there's a disassembler but not a decompiler 13:51:47 http://sprunge.us/SZNO 13:51:50 "'" words 13:52:00 would then display all words with a ' in their name 13:53:39 there is a source decompiler in autopsy (the 'see' there has three viewing options, source is one of them) 13:53:45 it's not flawless though 13:54:17 dictionary is a linked list, not a hashmap 13:54:40 ... 13:54:53 the structure is covered in the docs (link to prior, link to class, link to definition, zero terminated name) 13:56:35 what's the advantage of linking to the definition rather than just putting it right there inline? 13:57:29 this makes it possible to discard headers that don't need to be kept (e.g., for embedded targets like arduino with limited memory) 13:58:32 headers meaning...? 13:59:19 the name, pointer fields, etc 13:59:48 so a record in the dictionary list 14:00:01 yes 14:00:06 gotcha 14:05:53 I guess my conception of what a dictionary is looks something like this: (link to prior, link to {class/defining-word/whatever}, size, fixed-length-zero-padded name, definition ) 14:06:51 so if i know the definition, it's always a fixed offset jump to find the metadata 14:07:05 is that kind of what you meant by flat list? 14:09:47 the name is not fixed length 14:10:14 but otherwise yes 14:17:25 because there's a forth instruction pointer separate from the vm's... forth IP jumps to the definition, not to the actual code... 14:17:56 so you just need a cell saying how long the string is so you can jump, or just scan through it until you find the null. 14:18:28 wait 14:18:56 your forth pointer can't be working that way or your assembler wouldn't say to call numbers 14:18:59 disassembler 14:19:03 it would know the name 14:19:18 the simple disassembler doesn't do name resolution 14:19:33 the source decompiler in autopsy does 14:19:41 but it's longer 14:24:12 okay. thanks for answering all my questions. I hope i'm not annoying you too much :) 14:24:37 not at all :) 14:25:15 wait one more question 14:25:43 i was writing the game design doc most of the morning while salvager was trying to get the console working 14:26:10 he seemed to be on the right track from what he was saying but couldn't get any colors to show up. 14:27:44 the theory is c, c#, python, ruby and maybe php should all have port 8, right? 14:28:21 nm.. you already told me about the comparision page.. sorry.. i'm frazzled :) 14:41:31 @crc you know... we could add another field to the dictionary for a documentation string and then just /generate/ the docs directly from the dictionary... add another vm option to test whether docs are included so it's still easy to shrink. 14:42:51 kind of the basic idea for the b4 language i want to build is that it's basically a relational database, and the forth dictionary is just one table. 14:44:05 good for porting to AS/400 14:45:21 since that's so not forthlike, i was just paying attention to ngaro and ignoring retro... but since we wound up using it for the game i seem to be learning it anyway. :) 14:45:27 tangentstorm: port 8 still depends on ANSI support from the terminal in most cases 14:46:06 re: dictionary and documentation: I'm exploring this option 14:47:39 also, the quotes and the lexer have me torn... as a user of the language, i like your choices... but in introducing people to forth from scratch i like the simplicity of ." even though it looks completely silly to me :) 14:48:21 ok.. back to work. thanks again. :) 14:48:48 np 14:49:05 * crc is off to make supper; will check back in later 15:04:27 --- join: Kumul (~Kumul@cvx-ppp-66-50-52-16.coqui.net) joined #retro 15:20:05 --- quit: Kumul (Remote host closed the connection) 15:25:12 --- join: ricericericerice (~puppy@74-142-222-186.dhcp.insightbb.com) joined #retro 17:32:46 --- nick: tangentstorm -> tangent-afk 18:09:33 --- nick: tangent-afk -> tangentstorm 18:23:27 --- join: Kumul (~Kumul@cvx-ppp-66-50-52-16.coqui.net) joined #retro 19:52:44 --- join: arescorpio (~arescorpi@222-206-17-190.fibertel.com.ar) joined #retro 21:19:26 --- quit: ricericericerice (Quit: Leaving) 22:39:12 --- quit: arescorpio (Read error: Connection reset by peer) 23:48:41 --- quit: impomatic (Quit: http://RetroProgramming.com) 23:59:59 --- log: ended retro/12.08.04