00:00:00 --- log: started forth/06.10.08 00:02:07 --- join: arke_ (n=Chris@pD9E07DBE.dip.t-dialin.net) joined #forth 00:19:35 --- quit: arke (Read error: 110 (Connection timed out)) 00:33:54 --- quit: segher (Nick collision from services.) 00:34:04 --- join: segher (n=segher@dslb-084-056-145-148.pools.arcor-ip.net) joined #forth 00:47:50 --- join: Anbidian (i=anbidian@S0106000fb09cff56.ed.shawcable.net) joined #forth 01:06:02 --- quit: Anbidian () 01:58:47 --- nick: arke_ -> arke 02:14:11 --- join: virl (n=virl@chello062178085149.1.12.vie.surfer.at) joined #forth 02:45:58 --- quit: ASau (Read error: 104 (Connection reset by peer)) 04:06:06 --- join: zpg (n=user@user-54434544.lns6-c7.dsl.pol.co.uk) joined #forth 04:06:24 afternoon. 04:10:16 Good afternoon to you too sir. 04:12:21 hi there zadkiel, how're you doing? 04:12:32 Pretty well. 04:12:42 How about you? 04:14:33 good thanks 04:15:12 Have you used Linux? 04:15:46 yes, a while back. 04:16:24 Ah. I'm trying to use the shell to make 2 programs talk to each others using the normal pipes, do you know anything about it? 04:17:57 well, i've mainly used IPC in C. 04:18:02 what data are you trying to pass? 04:18:48 strings 04:19:00 an array of ... or ? 04:19:31 I'm trying to do something like $ 1.bin | 2.bin ... but make 2.bin to send its output to 1.bin. 04:19:44 streamed strings. 04:21:13 okay, simple stuff. 04:23:03 http://ezil.sourceforge.net/screenshots/ipc.jpg <-- a screenshot of a simple terminal session. 04:23:52 in other words, the first script prints its output to stdout as normal, same as always. 04:24:11 the second script simply reads from STDIN. equally, you could set a variable to the contents of stdin, etc. 04:24:28 but here one script echoes a string, the other does a character-count, so we get 9 as a result when they're piped together. 04:25:08 Ok, if I wanted to make a.sh to read from STDIN what b.sh writes to STDOUT, how could I do that? 04:25:32 well in my example, that wouldn't make sense. 04:25:46 Well, no. 04:25:49 zadkiel: I think the best solution on unix is to create a file socket 04:26:00 "unix socket" or whatever that's called 04:26:09 Ah. 04:26:13 JasonWoof: reckon it's necesarry for such a small example? 04:26:24 string passing is kind of a shell prerogative. 04:26:35 to be more cross-platform, you probably need to use networking (ie do listen() and accept() etc) 04:26:49 I'm only targeting linux. 04:27:02 I think it should be possible to use the shell for that, redirect stdin and stdout. 04:27:12 I was trying with a FIFO, but It didn't seemed to work. 04:27:13 listen() is a C call. does it exist for scripting too? 04:27:42 on linux you can do mkfifo -[I forget the options] my.fifo; a.bin < my.fifo | b.bin > my.fifo 04:27:50 it might stall though 04:28:03 hmm. 04:28:08 intriguing. 04:28:19 Oh, that sounds promising. 04:28:41 trouble is I'm not sure when the programs will stall 04:28:41 (afternoon JasonWoof ) 04:29:05 -I'm not sure if they stall when therey's no data available, or if they don't stall untill they try to read/write when there's none 04:29:12 hopefully the latter, because then it should work 04:29:14 it depends exactly what you're planning on doing. if the problem could be solved by a simple one way pipe using |s, i wouldn't opt for mkfifo, it seems overkill. 04:29:30 right 04:29:36 but if you're planning on doing more complex operations, then obviously Jason has pointed you to the right tool. 04:29:47 but he wants two-way communication between the processes 04:29:57 oh really? 04:30:16 ah, missed that bit. 04:30:19 * zpg shuts up 04:30:28 I'm trying to have program1 send a string to program2, which will process it and send a reply to program1 back, who will process it and send a reply to program2, ad nauseaum. 04:31:01 Round 2! Fight! 04:31:25 * zpg bows out in amidst accusation and myopic disgrace. 04:31:45 heh 04:31:57 no, no, I was referring to program 1 and program 2 arguing back and forth 04:32:39 Ah yes. 04:32:44 zadkiel: you may need to be aware of some buffering issues with the fifo 04:32:45 I'm going to make them troll and flame each other. 04:32:48 heh. same difference. 04:32:58 zadkiel: http://www.unixreview.com/documents/s=7460/uni1031588957510/ 04:33:06 try that. 04:33:24 zadkiel: after you write a certain abount to the fifo it will stop giving time to program 1 until program2 reads it. 04:34:12 If this is not the whole data packet that program2 wants, you'll have to have program 2 read the whole thing in from the fifo into some buffer or something, so that program 1 can continue running and output the rest of the message 04:34:45 Hm, I see. I'll have to take that into account. 04:34:48 same goes with regular pipes actually 04:35:56 it's no problem at all so long as you use the technique of reading is much as you can in order to find out how much there is 04:36:05 which is usually what I do anyway 04:36:35 well, I'm going to go read a book. Enjoy 04:36:43 Thanks for your help. 04:36:47 Enjoy your read :) 04:36:50 " 05:11:17 --- join: Anbidian (n=a@S0106000fb09cff56.ed.shawcable.net) joined #forth 05:20:38 --- join: luptenschteiner (n=User@ppp229-124.lns2.adl4.internode.on.net) joined #forth 05:40:21 --- quit: Cheery (Remote closed the connection) 05:43:43 --- join: Cheery (n=Cheery@a81-197-19-23.elisa-laajakaista.fi) joined #forth 05:47:16 --- join: crc (n=crc@pool-70-110-168-22.phil.east.verizon.net) joined #forth 05:47:46 --- mode: ChanServ set +o crc 06:17:51 good morning 06:20:20 Good mornings. 06:21:31 hi zadkiel 06:21:53 Hi erider, how are you? 06:22:55 I'm fine thank you and yourself? 06:23:13 I'm happy. 06:23:22 I managed to find out how to make 2 apps talk to each other. 06:29:00 cool! 06:29:06 in forth? 06:29:24 No, I'm still researching Forth. 06:29:39 Just had a little idea and tried it, nothing important. But it still makes me happy. 06:39:11 cool! what language did you use 06:39:18 C 06:39:48 It's pretty simple, just have the program send to stdout what you type in stdin. 06:39:49 cool! I have been doing a lot of C here lately 06:40:04 I just needed to set the stdout and stdin buffering as line buffering. 06:40:09 I haven't played with lisp for awhile now 06:40:31 And use a fifo to send the output of the program into the other program. 06:40:52 I want to learn Lisp, but it intimidates me. 06:50:44 --- quit: Anbidian () 06:57:49 --- quit: Quartus_ (Read error: 104 (Connection reset by peer)) 07:07:07 --- join: nighty__ (n=nighty@sushi.rural-networks.com) joined #forth 07:14:09 --- quit: erider (Connection timed out) 07:14:28 --- join: erider (n=erider@unaffiliated/erider) joined #forth 07:18:58 --- quit: nighty_ (Read error: 110 (Connection timed out)) 07:29:21 hi 07:29:54 zadkiel: you opted for C in the end? 07:35:43 zpg: C why not? 07:39:21 he was shell scripting earlier. i mentioned that i only really did ipc in c. 07:39:47 so this isn't "why c" it's "oh, you've decided to change the focus" 07:40:08 no 07:40:21 I used C to make the input/output, the IPC is made in bash 07:40:53 I used C because i'm more comfortable in C. 07:41:05 (I would have used java, but redirection from shell Is teh sux) 07:41:46 java seems like a huge overkill for such a simple task anyway. 07:41:55 (or anything else, but that's just my take heh) 07:42:25 True 07:42:30 But I like the language. 07:43:24 Now, my current "problem" is that I can send strings back and forth, but now I need to *actually* process the strings. 07:43:34 String processing in C is a bit annoying. 07:43:44 this is true. 07:43:52 process them how? 07:44:31 Well. So they can talk to each other, and know what the other is saying. 07:44:38 send commands and replies 07:44:38 Etc. 07:44:58 well parsing a string into whitespace separated components shouldn't be difficult. 07:45:06 *components -> tokens. 07:45:26 I'm thinking more a XML-ish kind of strings. 07:45:31 They seem more flexible 07:45:54 ah 07:45:59 Being a C programmer with many years experience, I have to disagree about the string processing statement. 07:46:09 value with any sort of special characters, including \n or \0 07:46:16 Of course, I say string processing in Forth is a major PITA, but there are those that disagree with me about that. 07:46:24 What are you trying to do, exactly? 07:47:15 k4jcw: sure, i'm thinking of built-in processes. like split(mystring, "\\w+"). clearly you can write your own. 07:47:23 I have this "master" program, which has a list of things to do, and have to tell the "slave" program what to do, and the "slave" has to report back to the "master" 07:47:38 OK. And why do you have to send binary data? 07:47:45 zadkiel: http://en.wikipedia.org/wiki/Expat_%28XML%29 07:47:55 strings, not binary. 07:48:00 zadkiel: the sf page seems unresponsive at the moment -- http://expat.sourceforge.net/ 07:48:03 value with any sort of special characters, including \n or \0 07:48:40 Gotta run. 07:48:44 Well, yes. So I can send CR and EOF in a string without having to escape it. 07:48:56 zadkiel: expat is an xml parser for c 07:49:08 (in case you're wondering why i'm giving you random links) 07:49:18 Ooh 07:49:22 That sounds useful. 07:49:29 "Expat is a stream-oriented XML 1.0 parser library, written in C. Expat was one of the first open source XML parsers and has been incorporated into many open source projects, including the Apache HTTP Server, Mozilla, Perl, Python and PHP." 07:49:32 etc. 07:49:54 Thanks. I'll check it out. 07:50:09 sure. 07:50:19 i've not used it, but Monsieur Google suggested it. 07:50:30 Google knows best. 07:51:01 he certainly does have a few tricks up his esleeve 07:51:24 And by esleeve(sic) you mean text box, rite? :P 07:51:49 if by rite you mean right, perhaps. 07:52:27 Ha ha. Too much internet, sorry. 07:52:34 i'm just joking. 07:52:39 I know. 07:52:41 if you hadn't already guessed. 07:52:43 I have to leave for a while. 07:52:55 okie doke. 07:53:06 I'll be back in a while, thanks for everything. 07:54:04 good luck. 07:54:05 ttfn 08:02:47 --- join: vatic (n=chatzill@pool-162-84-156-148.ny5030.east.verizon.net) joined #forth 08:05:34 hey vatic! 08:05:47 zpg: how's it going? 08:05:59 very well thanks. forthing again, reading some brodie, setting up forthos 08:06:25 incidentally, i think you might be interested by this: http://www.netjam.org/projects/quoth/demo 08:06:28 how're you? 08:08:16 zpg: doing ok. cool here. struggling with linked-lists... 08:08:24 the stack actually. 08:21:55 heh 08:21:59 how experienced in forth are you? 08:23:09 not well enough that I can use the stack elegantly... 08:28:01 That quoth thing is very cool. 08:28:55 There's a lot of interest in networked music now, although there have been networked computer bands since the mid-1970s... 08:29:03 zadkiel: yeah Latta's an interesting chap 08:29:29 vatic: are you intending on building dedicated hardware and programming with forth, or just using general purpose PC hardware? 08:30:35 zpg: time permitting, both. The microcontroller stuff is for networks of small synthesizers... 08:31:28 neat 08:31:36 i'm very interesting by that. 08:31:44 well, I've got some work to do... ;-) 08:31:47 heh heh 08:31:55 anyone here know grub? 08:32:10 zpg: what do you want to know? 08:32:22 oh hang on 2 seconds 08:32:38 yeah, http://www.forthos.org/setup.html <-- check out the bottom of that 08:32:39 you mean like the PC bootloader? 08:32:44 root= (hd0,1) 08:33:00 doesn't work here, nor does 'root (hd0,1)' nor 'root hd0 1' 08:33:04 vatic: yes 08:33:23 zpg: what hardware, what Linux? 08:33:43 hmm, VirtualPC hardware 08:33:47 and this is grub on the ForthOS booter 08:34:18 oh, got it 08:34:22 root (hd0,0) 08:34:43 awesome, it worked :) 08:37:11 "get ready for forth" --> (http://ezil.sourceforge.net/screenshots/fo.jpg) 08:43:33 can't get a connection there... 08:44:00 how does one create string constants in a standard way? 08:44:16 ah a shame. 08:44:20 try refreshing. sf is being slow today. 08:44:26 I'd like to say: c" foo" constant foo-str 08:44:41 sunday coders... 08:45:21 heh heh 08:52:35 still not figured out to how to get a string constant 08:52:36 ? 08:53:15 no 08:53:24 hmm ok 08:54:39 sorry i can't be of help. newbie<->newbie :) 08:56:48 zpg: that's OK. I can actually say c" foo" constant foo-str in CMF, but it's not standard. 08:57:57 you could do : foo-str s" foo" ; 08:58:08 not sure how hacky that is 09:00:44 zpg: I know there are lots of solutions which I could adopt, but I'm curious what the standard approach is. it's a Quartus Kwestion... 09:00:52 indeed it is. 09:03:32 although I'm sure segher and a number of others could answer as well... 09:10:43 --- quit: arke (Read error: 104 (Connection reset by peer)) 09:11:28 well i'm battling with finding a small and useful linux boot iso/img that will allow me to fdisk the virtualpc partition to type 158 09:11:34 so that forthos will work properly 09:12:30 answer what? 09:13:50 the C" thing? 09:14:32 C" is compile-only 09:15:07 and not a string anyway -- it's a packed string, instead 09:17:42 : ", ( str len -- ) dup c, here swap dup allot move ; : string-constant CREATE ", DOES> count ; 09:18:00 s" bla-di-bla" STRING-CONSTANT some-str 09:18:35 you can use PLACE as a factor of ", if you have it 09:23:11 * zpg does a dance. fs.root! successful 09:25:40 There's a bunch of ways to make a string constant. : mystring s" Hi there" ; is one. Gforth S" strings are persistent, so you can just say s" Hi there" 2constant mystring 09:31:24 segher: merci bien! 09:33:33 segher: packed string is AKA "counted string"? Which is not being encouraged by ANS? 09:35:35 --- quit: Raystm2 (Read error: 110 (Connection timed out)) 09:36:13 Quartus: the 2constant approach is intriguing... 09:37:17 i assume (address,length) 09:37:27 that's it. 09:38:11 ForthOS is neat. 09:38:41 amazing what you can learn on #forth! 09:38:51 heh heh 09:39:56 sorry segher! drag 'n' drop screw up... 09:43:28 btw. did anybody anything graphically with ForthOS? 09:43:31 grr, sourceforge is being slow. 09:43:42 --- join: Raystm2 (n=NanRay@adsl-69-149-62-242.dsl.rcsntx.swbell.net) joined #forth 09:47:45 Saying "Sourceforge is being slow" is like saying "water is wet". 09:53:10 heh 09:53:19 http://ezil.sourceforge.net/screenshots/forthos.jpg for those with a screenshot fetish 09:53:31 but it doesn't seem to be responding here (yet) 09:54:55 good afternoon 09:56:47 afternoon 09:59:56 Hi crc. 10:00:20 I just replied to ASau on c.l.f. There must be an uptick in Forth interest; we're seeing more kooks than usual. 10:01:03 * k4jcw bows 10:02:03 must be the moon. 10:02:06 --- join: erider_ (n=erider@unaffiliated/erider) joined #forth 10:02:52 http://tinymicros.com/gallery/moon/100_0141 <-- moon 10:03:29 --- quit: erider (Read error: 110 (Connection timed out)) 10:03:32 Hi all. 10:03:41 k4jcw: now that's a confusing link. 10:03:43 Raystm2: hi 10:03:51 Confusing? 10:04:10 blue moon, dog in cast. 10:04:15 --- nick: erider_ -> erider 10:04:24 Her name is moon. She was sad because she had a cast on. 10:04:34 i gathered as much :) 10:06:52 What's confusing is the cleaning girls, who are Spanish, call her Luna. And while 'moon' in Spanish is indeed 'luna', I don't think you're supposed to translate named. 10:06:56 names. 10:10:33 well, michaels who go on holiday to france turn into michels 10:10:41 --- join: arke (n=Chris@pD9E07DBE.dip.t-dialin.net) joined #forth 10:10:41 --- mode: ChanServ set +o arke 10:18:48 --- quit: luptenschteiner ("Leaving") 10:28:55 --- quit: erider (Read error: 110 (Connection timed out)) 10:29:54 --- join: erider (n=erider@unaffiliated/erider) joined #forth 10:35:17 --- quit: arke ("odighasdofuih") 10:40:15 Quartus: I put up the backtracking example code here: http://forth.pastebin.ca/194944 10:41:00 and the update of your linked lists plus a 1st try at the "knowledgebase" here: http://forth.pastebin.ca/194943 10:43:58 --- join: erider_ (n=erider@unaffiliated/erider) joined #forth 10:53:07 --- quit: erider (Read error: 110 (Connection timed out)) 10:54:57 --- nick: erider_ -> erider 10:55:15 --- join: Quartus_ (n=Quartus_@209.167.5.1) joined #forth 10:55:15 --- mode: ChanServ set +o Quartus_ 10:55:41 I miss anything? 10:56:37 Quartus: I put up the backtracking example code here: 10:56:37 http://forth.pastebin.ca/194944 10:56:37 and the update of your linked lists plus a 1st try at the 10:56:37 "knowledgebase" here: http://forth.pastebin.ca/194943 10:58:08 urgh! forgot the ticks in certain places. I updated, but now it's called "Something" 10:59:43 Unfortunately I'm mobile; examination of the code will have to wait until tonight. 11:00:15 Quartus: no hurry! I wouldn't want you solving it and spoiling my fun anyway... :-) 11:01:04 heh 11:01:26 :) 11:03:10 --- join: Crest (n=crest@p5489786D.dip.t-dialin.net) joined #forth 11:40:54 what else is up? 11:41:19 i just wrote a really clumsy exponent word. 11:41:34 integer or float? 11:41:38 oh, integer. 11:41:47 : ** ( n expt -- result ) 11:41:47 swap dup rot 11:41:47 dup 1 > if 11:41:47 1 do over * loop swap else drop then drop ; 11:42:01 eep! 11:42:10 quite. 11:42:29 7 2 ** ==> 49 11:43:16 from the basic operator **? 11:43:29 this is my definition of ** 11:43:41 7 3 ** ==> 343, 7 1 ** ==> 7 11:43:51 right, I mean the choice of name. 11:44:01 yeah, Brodie exercise. define **. 11:44:16 does it handle 7 0 ** -> 1 ? 11:44:26 ack 11:44:36 * zpg weeps 11:44:38 guess. 11:44:46 heh 11:45:03 i could write a cleaner recursive i reckon. 11:45:19 can be done without recursion. 11:47:30 just a simple do...loop, handling 0 as a special case first. 11:48:10 11:48:10 : **new 11:48:10 dup if 0= else 11:48:10 dup if 1 = drop else 11:48:14 1 do over * loop drop then then ; 11:48:18 that seems nice. 11:48:46 closer. Can be simpler yet. 11:49:25 okay, i'm open to a suggestion :D 11:49:47 I thought you didn't want me to write it for you? :) 11:49:51 heheh 11:49:57 well, i'm chuffed with **new so far 11:50:05 but no ideas coming to mind for cleaner implementation. 11:50:18 a hint? 11:50:51 Doesn't handle exponents of 0 yet, does it? 11:50:57 yes 11:51:33 you've tested it? 11:52:14 yep. the very first condition, though re-reading seems odd. 11:52:19 i'm not dropping my duped zero. 11:52:26 err hang on. 11:52:33 oh, nope. 11:52:46 I'm a bit lost by your conditionals. I can't easily run the code here. 11:54:02 one cleanup -- 1 ?do can eliminate an entire if. 11:54:32 oh nice. 11:56:03 okay, this has gone from being operational to totally screwed. 11:56:52 :) 11:58:53 can i call .s from within a word definition? 11:58:59 (debug) 11:59:55 yes. 12:00:27 weird behaviour here. 12:06:24 I've written and tested one, and let me just say telnet is no fun from this gadget. :) let me know if you want it. 12:08:04 7 0 ** ok 12:08:04 7 1 ** ok 12:08:04 7 2 ** ok 12:08:04 7 3 ** ok 12:08:08 .s <4> 1 7 49 343 ok 12:08:10 12:08:14 my code: 12:08:17 (still ugly) 12:08:19 12:08:23 : ** 12:08:25 dup 0= if drop drop 1 else 12:08:28 swap dup rot 12:08:31 1 ?do over * loop swap drop then ; 12:08:36 what do you think? 12:08:39 still horrible? 12:09:15 drop drop is 2drop. Swap drop is nip. 12:09:34 ah 12:09:38 didn't know those 12:09:52 swap dup rot is over swap. 12:10:14 ah of course 12:10:29 here's mine: 12:10:37 : ** ( n1 +exp -- n2 ) dup 0= if 2drop 1 exit then over swap 1 ?do over * loop nip ; 12:11:05 neat, i see you're using exit which is cleaner. 12:11:07 here's mine now: 12:11:13 : ** 12:11:13 dup 0= if 2drop 1 else 12:11:13 over swap 12:11:13 1 ?do over * loop nip then ; 12:11:15 not so different from yours. I chose early-exit over else. 12:11:26 --- join: snoopy_1711 (i=snoopy_1@dslb-084-058-117-068.pools.arcor-ip.net) joined #forth 12:11:35 right, either approach works. 12:11:35 so is nip defined as swap drop/ 12:11:45 or is it a lower level definition? 12:11:49 thanks for the help. 12:11:52 it has the same action as swap drop. 12:12:01 oh, sure. but my question is: 12:12:07 would it be defined : nip swap drop ; 12:12:11 or would nip be a builtin? 12:12:21 it's likely a primitive, but how it's implelented is secondary to its action. 12:12:25 sure. 12:12:29 excellent. 12:12:43 it's a core-ext word. Could be built in, could be source. 12:12:58 neat. on the palm it's ...? 12:13:16 a primitive. 12:13:20 neat. 12:13:31 is your system written in C btw? 12:14:21 no, no C at all. It's written in a custom Forth target compiler, hand-coded assembly mixed with Forth. 12:14:41 oh, nice. did you write the custom compiler? 12:14:49 I did. 12:15:00 this is cool stuff. 12:15:16 starting forth '81 doesn't mention nip btw. so this little exercise has helped on two fronts. 12:16:08 yes, it's the most out-of-date revision of that book, which is badly out of date even in later revisions. 12:16:34 grab the Standard if you haven't already. 12:17:47 --- quit: Snoopy42 (Read error: 145 (Connection timed out)) 12:18:05 --- nick: snoopy_1711 -> Snoopy42 12:18:07 * zpg checks his old Forth dir 12:18:45 there's a pdf copy at quartus.net, html link in the topic. 12:18:51 incidentally, quartus forth -> 'not', undefined word 12:19:00 yeah i saw the topic link 12:19:58 fetching your pdf copy 12:20:09 not isn't a built-in in Quartus Forth. It's not a standard word. ' 0= alias not works. 12:20:40 or, ' invert alias not 12:20:58 ah ok thanks 12:21:06 if you ony use not to invert properly-formed flags, either works. 12:23:01 * zpg nods 12:23:07 i take it tuck could be defined : swap over ; 12:23:09 erm 12:23:14 : tuck swap over ; 12:23:28 yup. 12:23:34 niiice. 12:26:23 : tuck swap over ; 12:26:32 right. 12:36:01 although some systems like to do : swap tuck drop ; instead :-) 12:41:22 --- join: arke (n=arke@pD9E07DBE.dip.t-dialin.net) joined #forth 12:41:34 ahh, interesting. 12:41:53 okay, so another question - is 'cell' still defined as a 16-bits? 12:43:26 nope 12:43:53 a cell is _at least_ 16 bits though 12:44:10 hmm, okay. 12:44:20 so is a 'cell' defined as 'the size of a single'? 12:44:21 it's not required to be two's complement either 12:44:27 or vice versa? 12:44:33 a cell _is_ a stack entry 12:44:47 okay. 12:44:57 so the size of the single is defined by the implementation's cell-size? 12:45:03 yeah 12:45:07 thanks. 12:46:32 --- quit: Quartus_ (Read error: 104 (Connection reset by peer)) 13:04:46 --- quit: Cheery ("Download Gaim: http://gaim.sourceforge.net/") 13:33:55 "On the stack, the cell containing the most significant part of a double-cell integer shall be above the cell containing the least significant part." does that mean a 4 double should be '0 4' on the stack? 13:42:58 --- quit: neceve ("Leaving") 13:45:21 zpg: os that from dpans? 13:45:24 is 13:55:37 zpg: looks to be the case here. try it! 14:16:49 --- join: Quartus_ (n=Quartus_@209.167.5.1) joined #forth 14:16:49 --- mode: ChanServ set +o Quartus_ 14:17:13 what did I miss? 14:19:38 Nothing about gruffness in the linked list code? 14:19:45 zpg: 0 on top 14:21:06 --- quit: zadkiel ("OMGLOWINMEMORYOHNUSINEEDZMOREDIGIBYTES!!") 14:22:40 yes, from dpans. ah ok, so i've got it backwards? 14:34:55 yeah 14:41:40 --- quit: arke (Read error: 131 (Connection reset by peer)) 14:44:15 --- join: arke (n=arke@pD9E07DBE.dip.t-dialin.net) joined #forth 15:07:20 Quartus: trying to delete nodes, working on the condition where I'm deleting (freeing) the last node... 15:07:52 FREE is not guranteed to leave linked-list constant list1 at nil is it? 15:13:07 vatic: no 15:13:36 they say that you should free(ptr) and ptr = NULL 15:16:20 erider: so it's NOT guaranteed to leave ptr = 0? 15:17:18 I'm not sure if there is a guaranteed but thats what I have learn is to set it to NULL 15:18:11 so if you try to use it by accident you do mess with freed heap memory 15:19:28 vatic, what free? Standard one? Or some linked-list-specific version? 15:27:56 erider: Oh, now I make sense of your statement, thanks... 15:28:18 Quartus: I'm writing the reverse of your add-node... 15:28:42 question is, what should happen when I get to del-node the last node? 15:29:18 I assume I free the last node and leave the constant so I can add-node again in the future... 15:29:44 vatic: are you writing it in C? 15:30:09 erider: no, this is a forth channel, right? :-) 15:31:27 lol 15:31:35 ok 15:31:49 Quartus: but maybe if I'm doing this then I shouldn't be using a constant? 15:32:14 erider: actually, I guess I could be writing yet-another-forth-in-c though... 15:32:51 Quartus_: anyway, yes, standard Forth "free" 15:52:13 free only frees memory; it won't update your pointers. 16:09:10 erider, Quartus_ thanks! 16:10:09 no worries vatic 16:12:52 erider: just wanted you to know that I appreciate your efforts on behalf of my education. :-) 16:14:05 :) 16:15:32 --- quit: arke (Read error: 104 (Connection reset by peer)) 16:17:10 --- join: arke (n=arke@pD9E07DBE.dip.t-dialin.net) joined #forth 16:30:08 vatic: the common refrain in here :) 16:31:21 zpg: there are very generous folks on the list. I wished there'd been an Internet when I was learning C and 386 asm... 16:32:25 when was that? 16:33:35 free? malloc? hmm.. well if there is a way of memory allocation which fits more forths requirements? 16:36:25 vatic: indeed. 16:37:41 Quartus_: around 1983-85... 16:37:58 we had internet back then 16:38:31 who's "we"? 16:38:37 segher: Ok, true. But if you weren't associated with a university, access was difficult. 16:38:46 yeah 16:39:02 I had to convince the chem prof to let me have net access on the sun box 16:39:53 For me, I spent $$ on long distance to access remote BBS's by modem. Remember PC-Pursuit? 16:40:28 I'm forgetting about Compu$erv et al, though... 16:58:46 --- quit: virl (Remote closed the connection) 17:09:30 --- join: Quiznos (i=1000@unaffiliated/quiznos) joined #forth 17:28:34 --- part: arke left #forth 17:31:22 --- join: arke (n=arke@pD9E07DBE.dip.t-dialin.net) joined #forth 17:42:42 any crit, thoughts, suggestions? 17:42:44 : del-node ( list -- ) 17:42:45 dup @ dup cdr nil <> 17:42:47 if dup cdr swap free throw swap ! 17:42:49 else free throw nil swap ! 17:42:50 then ; 17:43:09 call me crazy, but i am very impressed with IE7 17:49:38 crazy. 17:54:17 vatic, what is that word supposed to do? 17:56:19 looks like it may shorten a list by one node. 17:56:33 in which case it needs a better name. 17:57:33 note too that swap ! is common to both conditional branches, and so can follow then. 18:03:31 Quartus: hopefully, it does the opposite of your add-node. It removes the first (ie last added) node in the list, or the last node, if there's only one. 18:05:10 (didn't catch the swap !, thnx. 18:05:33 ) 18:07:46 then delete-first-node. 18:08:26 otherwise I'd expect to be able to pass a node address, or index, or something. 18:11:34 --- join: TheBlueWizard (i=TheBlueW@ts001d0609.wdc-dc.xod.concentric.net) joined #forth 18:23:31 Quartus_: Ok 18:23:42 : delete-first-node ( list -- ) dup @ ?dup if dup cdr over free throw swap ! else drop then : 18:24:02 untested, I'm travelling. 18:25:31 it may be unimportant to throw the value from free, or it may be advantageous to return the ior as the result. 18:25:46 Quartus_: thanks for the alternative. Won't get a chance to work with it tonight probably... 18:26:02 : unlink-first-node ( list -- node ) dup @ dup cdr rot ! ; : delete-first-node ( list -- ) dup @ IF dup unlink-first-node free THROW THEN drop ; 18:26:22 it's perhaps a bit simpler. It doesn't re-write the nil. 18:27:10 segher, unlink-first-node strikes me as an odd factor. 18:27:41 not really, it just unlinks (and returns) the first node from the list 18:27:57 you often want to _do_ something with the node you're removing 18:28:06 unlink-node, maybe, but I wouldn't have it return the passed node address; that can be dup'd going in. 18:28:36 it's not passed in, the list is passed in, it returns the unlinked node's address 18:28:54 erm, it doesn't, i messed that one up :-) 18:29:11 erm... no i didn't 18:29:20 anyway, bed time for sure, heh 18:29:40 heh 18:38:51 one enhancement to the list code: nil car and nil cdr should always return nil. 18:45:21 So : cdr dup if >cdr @ then ; 18:45:28 etc. 18:45:38 simplifies things. 18:46:39 Quartus_: interesting. 'night segher! 19:06:02 also free-node should be written. 19:09:19 --- part: TheBlueWizard left #forth 19:14:59 g'night y'all... 19:15:04 --- quit: vatic ("*poof*") 19:23:24 --- quit: arke (Read error: 110 (Connection timed out)) 19:48:40 night 19:48:41 --- quit: zpg ("ERC Version 5.1.3 (IRC client for Emacs)") 19:50:40 --- join: Joely (n=kororaa@adsl-70-131-102-168.dsl.emhril.sbcglobal.net) joined #forth 19:58:59 hello! i'm new to forth and i think it's amazing! since i'm new and everything, i'd really like to make _my_ first real program...not just copying line by line a program in order to learn forth, but actually come up with something exciting! so i was thinking of writing a telnet/ssh like program with support to boot from it. i've read most of those docs up there in the motd, just wondering if there's any more resources people rea 19:59:15 cut off at "more resources people rea" 19:59:22 oops sorry 19:59:27 i've read most of those docs up there in the motd, just wondering if there's any more resources people really like for encryption or networking tips in forth! 20:00:10 Networking is going to be an implementation-specific thing. If I were tackling it, I'd start with Gforth for prototyping. 20:01:28 What kind of encryption are you looking for? 20:04:40 hmm, just something `simple' to start out with like ssh authentication and then i'd move on to implementing the public key algorithms... 20:05:01 I'd think the simplest first approach would be to make a telnet client. 20:05:12 No encryption; get the networking up and running. Then add other stuff. 20:06:07 right, now i dunno this is an implementation specific thing...but do you happen to know if the openfirmware specification abstracts the networking drivers? 20:06:22 I don't know. What platform are you writing for? 20:06:49 oh, i'm just trying to make universal code for open bios or openfirmware 20:06:57 right now i'm on ppc 20:07:19 Ok. You'll have to consult the OF spec; I'm not especially familiar with what it provides. 20:08:04 It strikes me as a rather tough row to hoe, starting out; you'd have an easier time learning & writing with a hosted Forth under an OS. You could always port to OF later. 20:11:46 oh, ok, i guess i was being really stupid...there's not like some repository for Forth words like there's CPAN for perl is there? 20:12:15 Perl and CPAN are a pretty unique thing. Forth is pretty widely distributed, no central repository. 20:16:23 so how do developers not feel like they are reinventing the wheel over and over again for each program they write code? 20:17:01 or do people write any libraries in forth? 20:17:25 I know I don't feel that way. I don't know what language you know best already, but Forth is a somewhat different animal. If you're looking for the identical facilities you find in, say, C, you'll find in frustrating. 20:18:46 it, rather. 20:19:13 If you read Thinking Forth, you'll have a better understanding of the differences. 20:19:35 ok, i shall try reading it again...this time much more closely :) 20:20:50 If you're just looking for an assurance from an experienced Forth coder, then rest assured that I, at least, don't feel like I'm reinventing the wheel over and over again. :) 20:21:25 ah phew, thanks :-D 20:23:24 oh no! thinking forth is down right now 20:23:27 at least for me 20:24:59 here's another online copy: http://maschenwerk.de/TF/page_0.html 20:25:31 hurray thanks! 21:19:22 --- join: nighty_ (n=nighty@sushi.rural-networks.com) joined #forth 21:30:42 --- quit: nighty__ (Read error: 110 (Connection timed out)) 21:45:03 --- quit: erider ("I don't sleep because sleep is the cousin of death!") 22:14:46 --- join: crest_ (n=crest@p5489435B.dip.t-dialin.net) joined #forth 22:24:03 --- quit: Crest (Read error: 110 (Connection timed out)) 23:59:59 --- log: ended forth/06.10.08