00:00:00 --- log: started forth/06.10.02 00:06:39 --- quit: arke (Read error: 60 (Operation timed out)) 01:01:05 --- join: snowrichard (n=richard@12.18.108.162) joined #forth 01:01:18 hi 01:02:40 hi snowrichard 01:05:51 morning crc 01:06:04 how's it going? 01:06:16 pretty good 01:06:34 I've been in my new place for a month already. seems like it flew by 01:07:16 \ 01:10:13 --- join: Cheery (n=Cheery@a81-197-19-23.elisa-laajakaista.fi) joined #forth 01:10:31 hi Cheery 01:25:26 hi 01:30:29 --- nick: arke_ -> arke 01:30:31 good morning 01:51:30 * crc is slowly making progress reworking the GTK+ bindings 01:58:46 Cool. :) 01:59:13 I'm using the class functionality this time, which should let me make it a lot cleaner 01:59:13 /msg nickse 01:59:15 oops 01:59:26 --- mode: ChanServ set +o arke 01:59:35 cool 02:42:09 the first class (.button) is done :) 02:42:26 the rest should be much easier 03:12:17 Yay :) 03:51:28 ooooh I want ops too! 03:51:35 =) 03:52:25 --- mode: arke set +o Teratogen 03:52:32 --- mode: arke set -o Teratogen 03:52:37 thanks! =) 03:52:43 your few secodns of fame :P 03:52:47 ops for second! 03:52:54 hehe 03:53:46 s/second/a second/ 03:53:48 that is 03:54:40 to use a Perlism ;-) 03:54:45 :) 03:54:52 heark, it'a arke! 05:09:42 --- join: PoppaVic (n=pete@0-2pool238-47.nas24.chicago4.il.us.da.qwest.net) joined #forth 05:40:03 --- quit: snowrichard ("Leaving") 05:52:06 --- join: timlarson_ (n=timlarso@65.116.199.19) joined #forth 06:11:33 --- join: Ray_work (n=Raystm2@199.227.227.26) joined #forth 06:29:51 --- nick: Raystm2 -> nanstm 06:47:25 --- nick: crest_ -> Crest 06:47:55 hi 06:48:04 howdy 06:48:21 do you know if their is a forth system for the newton 130? 06:48:34 no idea - another plamtop? 06:49:10 the first pda 06:49:24 ahh, those 06:49:27 that was usable 06:49:48 well, I'm sure _someone_, _somewhere_ has ported forth to it 06:49:53 their were some tries before with 8 bit cpus and a dos like system 06:50:06 forth/a forth-variant 06:50:24 there were plenty - most based on FIG 06:50:38 a forth-variant would be nice an ans forth system greate 06:58:55 Crest, You might wait 'til Quartus is here and ask that question again. 07:05:06 --- join: vatic (n=chatzill@pool-162-84-156-148.ny5030.east.verizon.net) joined #forth 07:14:24 I don't believe there was ever a Forth for the Newton. 07:25:44 I remember somebody talking about an eForth port written in NewtonScript, but it never appeared anywhere. That would have to be an amazingly slow and limited Forth. 07:26:19 wasn't the newton a stylus-based thing w/o a kbd? 07:35:46 --- quit: Quartus__ ("used jmIrc") 07:39:33 --- join: Quartus_ (n=Quartus_@209.167.5.1) joined #forth 07:39:33 --- mode: ChanServ set +o Quartus_ 07:43:15 I have a NewtonScript shell I wrote a year or so ago, which currently 07:43:17 hosts a Forth (written in NewtonScript, but based on eForth by Bill 07:43:19 Muench, and developed in collaboration with him). 07:43:21 -Paul Fernhout 07:43:22 http://lists.squeakfoundation.org/pipermail/squeak-dev/1998-December/023190.html 07:43:39 Yeah, that was it. I don't think it ever saw the light of day. 07:43:50 NewtonScript was no speed demon; a Forth on top of that would be painful. 07:44:17 maybe it's still compiling somewhere? 07:44:23 Compiling? 07:44:31 eForth? 07:44:34 Oh, because of the speed. :) 07:45:41 The disappearance of the hardware was faster than the eForth compiler. 09:10:32 --- log: started forth/06.10.02 09:10:32 --- join: clog_ (n=nef@bespin.org) joined #forth 09:10:32 --- topic: 'Welcome to #forth. We discuss the Forth programming language, simplicity, and a variety of technical subjects. Introduction: http://tinyurl.com/kvawv | Starting Forth: http://tinyurl.com/rm7pq | Thinking Forth: http://tinyurl.com/nsy4j | Gforth compiler: http://tinyurl.com/s8uho | ANS/ISO Forth Standard doc: http://tinyurl.com/nx7dx | Paste >5 lines: http://forth.pastebin.ca/' 09:10:32 --- topic: set by Quartus on [Wed Aug 30 23:43:43 2006] 09:10:32 --- names: list (clog_ virl I440r @Quartus_ vatic Ray_work timlarson_ Cheery @arke @Quartus timlarson Crest Jim7J1AJH Snoopy42 clog nighty_ larsb TreyB madwork @JasonWoof virsys @crc fission Quiznos Teratogen jcwren Zarutian nighty Zymurgy nanstm michaelw ohub warpzero juri_ ccfg) 09:16:56 --- join: futhin_ (n=wunderwa@bespin.org) joined #forth 09:17:37 --- nick: futhin_ -> futhin 09:17:42 --- mode: ChanServ set +o futhin 09:18:35 --- part: futhin left #forth 09:26:31 --- quit: clog (Read error: 110 (Connection timed out)) 09:26:32 --- nick: clog_ -> clog 10:25:17 --- quit: vatic ("*poof*") 10:58:06 --- join: neceve (n=claudiu@unaffiliated/neceve) joined #forth 11:46:00 --- quit: TreyB (Read error: 110 (Connection timed out)) 11:57:36 --- quit: Quiznos (Excess Flood) 11:57:40 --- join: Quiznos (i=1000@69-168-231-199.bflony.adelphia.net) joined #forth 12:06:49 --- join: snoopy_1711 (i=snoopy_1@dslb-084-058-179-030.pools.arcor-ip.net) joined #forth 12:15:01 --- quit: Snoopy42 (Read error: 145 (Connection timed out)) 12:15:04 --- nick: snoopy_1711 -> Snoopy42 12:31:55 --- quit: ohub (Remote closed the connection) 12:32:18 --- join: jcw (n=jcw@adsl-074-238-180-251.sip.asm.bellsouth.net) joined #forth 12:32:26 Quartus, Quartus_, you around? 12:36:08 mmm Newton 12:36:13 I always wanted an eMate 300 12:46:23 --- join: ohub (n=oherrala@sikw1.oulu.fi) joined #forth 12:53:06 --- join: snowrichard (n=richard@12.18.108.162) joined #forth 13:17:00 --- join: erider (n=erider@unaffiliated/erider) joined #forth 13:23:40 --- join: TreyB (n=trey@cpe-66-87-192-27.tx.sprintbbd.net) joined #forth 13:30:11 --- quit: timlarson_ ("Leaving") 13:36:17 --- quit: ohub (Remote closed the connection) 13:48:49 --- join: ohub (n=oherrala@sikw1.oulu.fi) joined #forth 14:18:26 --- join: vatic (n=chatzill@ool-45740b1c.dyn.optonline.net) joined #forth 14:36:41 --- quit: neceve ("Leaving") 14:39:17 --- quit: vatic (Remote closed the connection) 14:53:09 --- quit: jcw (Read error: 110 (Connection timed out)) 14:59:30 --- quit: Cheery ("Download Gaim: http://gaim.sourceforge.net/") 15:00:03 --- quit: Ray_work ("User pushed the X - because it's Xtra, baby") 15:18:49 Hi jcw. 15:18:55 oops, missed him. 15:40:24 --- join: madgarden (n=madgarde@Kitchener-HSE-ppp3577114.sympatico.ca) joined #forth 15:43:42 string hash = Convert.ToBase64String(new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(System.Text.Encoding.Default.GetBytes(SomeString))); 15:43:58 That's C#. Impressive, if only for its length! 15:45:31 A programmer must really feel he's earning his keep when he gets all 12 names right in that sequence. I suppose the IDE does most of the heavy lifting in producing this Jabberwocky, though. 15:47:31 hi Quartus 15:47:35 oh.. my god and I thought Java is a pita 15:47:36 Hi erider. 15:47:55 hi virl 15:49:12 the next step would be: Please, get the Bytes out of and compute a MD5 hash out of it and put it into variable hash, which is a string. 15:49:22 That's actually shorter. 15:49:25 wow.. that's even shorter.. 15:50:05 Quartus: thats such a BS line of code 15:50:28 ehm.. I think we have now found out a new thumb rule... never design constructs which are longer than the explaining sentence.. 15:50:43 arke, it showed up today on a snippets site. 15:50:58 Then its somebody so new to C# who doesnt understand using 15:51:37 ehm.. arke? 15:51:45 Thats seriously such a bullshit line of code 15:51:52 arke can C# be used on linux? 15:52:00 erider, yes.. 15:52:00 erider: yes, using mono or DotGNU 15:52:01 What's the non-bullshit version? 15:52:32 Quartus: Ignoring the fact that you'd keep the CryptoServiceProvider stored somewhere 15:52:50 whats the differences between ObjectiveC and C# 15:52:57 string hash = Convert.ToBase64String(new MD5CryptoServiceProvider().ComputeHash(GetBytes(SomeString))); 15:53:00 erider, a lot of 15:53:05 However 15:53:07 I would never do that 15:53:13 its horrible, horrible, HORRIBLE style 15:53:19 ObjectiveC is smalltalk and C mixed together.. 15:53:43 I'm assuming there has to be some prologue somewhere that provides all eight other specifiers. 15:53:44 hmm. that maybe interesting 15:53:55 C# is (C++) + Java | streamlined 15:54:10 Quartus: yes, at the beginning of the document you do using ...; just like in C++ or Java 15:54:27 So the one-liner from the snippets site is the entire code required. 15:54:36 Yeah. 15:54:40 I guess the one-liner is all thats required 15:54:46 (the streamlined is from arke, I would say it's only Java on drugs) 15:54:52 but you can also write a mandelbrot generator in forth in one line 15:54:55 doesnt mean you should 15:55:02 wow 15:55:10 note to self add ObjectiveC to your list and subtract C# 15:55:31 erider, ? 15:55:57 Quartus: good style would be keeping the service provider saved somewhere, doing the whole thing in 2 or 3 steps, as well as doing the using statements so you dont have such a huge line of code 15:56:03 virl: and stop being a fucking fanatic 15:56:23 Sheesh. 15:56:29 heh.. I wasn't now a 'fucking fanatic' 15:56:32 virl: i'm going to add objectiveC to my list of languages to learn 15:57:08 erider: Are you looking for languages to learn to be competitive in the marketplace or just for fun/hobby/education of yourself? 15:57:08 arke, no doubt. You can see why that impresses, though -- it's an astonishing amount of hierarchy, even if it can be shorthanded by 'using' statements. 15:57:09 erider, ok, it wasn't clear what you meant 15:57:21 sorry :) 15:57:28 Quartus: I prefer the hierarchy. Have you ever managed a large C application? :) 15:57:37 erider, not your fault, it was mine. 15:57:52 arke, yes. Fortunately I also wrote it, so it was well-factored. 15:58:04 Quartus: haha :) 15:58:12 no worries :) 15:58:31 flat hierarchy is nicer, doesn't attack my nerves. 15:58:59 virl: who cares about your nerves though? 15:59:11 I do.. 15:59:20 I don't think the only two choices are flat and twelve-levels-deep. That code surprises me because it has GetBytes, instead of Get.Bytes. :) 15:59:21 Of course you do :) 15:59:47 Quartus: Thats about as deep as .NET gets though. 15:59:49 And ComputeHash instead of Compute.Hash. 15:59:57 Although there are "enterprise" 3rd party things that are even deeper 16:00:04 And now you're just being silly :D 16:01:20 The hierarchy in .NET isn't ideal, sure 16:01:26 but in combination with a 16:01:28 oops 16:01:49 but in combination with an IDE with code completion, it is very very easy to use. 16:01:55 I'm not pro-IDE. 16:02:03 Neither was I. 16:02:20 Then I had to actually sit down and use Visual Studio 16:02:23 and I developed a liking for i. 16:02:25 it. 16:02:40 If you have to use it, it's better to like it than hate it. :) 16:03:17 I use it as a debugger, but do all of my editing in gvim. 16:03:25 well... graphical programming would be better.. 16:04:35 clicking would be faster than typing in such big hierarchys 16:05:01 Its just so easy to write this.fo and Visual studio pops up with a little list right there, with "foobar" selected, and a little mini window next to you telling you what it is. 16:05:12 virl: nope, typing is still faster 16:05:17 Sys 16:05:19 oops 16:05:24 vim must be fun, there is a lot of people in the channels I visit that use it. No one uses emacs? 16:05:47 I type Sys.Win.F for System.Windows.Forms 16:05:54 I've never really warmed to emacs, although I've tried (minimally) on more than one occation. 16:06:04 arke, that's an old fart, this word completion, so what? 16:06:21 virl: Why would you want clicking when you have that? 16:06:23 Not to mention 16:06:25 It has advantages in that it can run interactive sub-processes in a window where vim can not. 16:06:32 virl: as you complete, it shows you what it does what you currently have selected. 16:06:47 emacs is an OS packaged as an editor :) 16:07:45 arke I use emacs but I haven't found anyone else in the channels I visit that do too minus #emacs 16:08:15 well, it depends on the audience 16:08:17 and of course #lisp 16:08:31 forth-y people tend to prefer vim because its more minimalist 16:09:17 I prefer vim also because emacs hurts my wrists with its combos, and the simple strokes in vi don't :) 16:09:26 I have forth support in emacs 16:09:44 well.. I think they prefer emacs, because of it's quick startup time 16:09:53 wtf1? 16:10:01 vi starts up much quicker than emacs anyday 16:10:11 eh, vim.. oops a typing error 16:10:30 Much better :) 16:11:00 maybe I should give vim a look 16:11:39 any good vim tutorials on line? 16:11:46 emacs.. puh it has this annoying strg+alt+N shortcuts 16:11:52 vim includes the "vimtutor" program 16:12:09 gvim or vim 16:12:12 if you're on linux/bsd at least 16:12:21 linux 16:12:22 well, they're both the same, except that gvim comes up in an X window :) 16:12:34 type "vimtutor" at the command line, that should bring up the tutorial 16:13:03 well well.. when will .net leave this channel? 16:13:06 cool 16:13:48 virl: ..the fuck? I'm not even talking about .NET, I'm helping the guy learn Vi 16:14:21 whatever... drink a tea and cool down 16:14:27 Look who's talking. 16:14:34 and setup for C or lisp? 16:14:45 Your incessant angry whining is really getting on my nerves. And thats a first for me on IRC. 16:14:56 erider, do you mean syntax hightlighting and such? 16:14:59 erider: erm, I don't know what you're asking? 16:15:01 yes 16:15:24 well.. syntax highlighting is easy 16:15:26 never mind I will google it 16:15:49 erider: It does it automatically ... if you load up a .c file, it uses C highlighting, etc. 16:16:02 you need only to change vims config or give at runtime into it's 'console' syntax on 16:16:06 erider: although, depending on sttings and installation, it might not do this automagically, so theres a command, I think its :color on 16:16:14 or something similar 16:16:16 my emacs does more than that 16:16:24 and then, as virl says, put it in the config :) 16:16:27 its formats the code 16:17:02 erider, so this crazy auto formatting? which makes lisp code readable? 16:17:03 and I have templates that I can add with a few key strokes 16:18:04 well, then I think you shouldn't change, because I don't know anything of such an autoformater for vim. 16:18:18 ah 16:18:22 which is imho an argument against lisp.. 16:18:31 no worries I want to give it a try 16:18:52 which one? lisp or vim? 16:18:59 vim 16:19:05 I use lisp now 16:19:36 emacs with slime 16:20:11 I ask myself often how it's possible to use lisp for something useful 16:20:38 hmm.. reminds me on oop.. 16:21:14 nested lisp parantheses and nested oop accesses aren't really nice to read 16:22:23 well night folks, the bad fanatics grandfather goes to sleep. 16:22:48 --- quit: virl (Remote closed the connection) 16:34:04 --- join: fnord123 (n=fnord@user-3e885460.telcl19.dsl.pol.co.uk) joined #forth 16:58:18 --- quit: snowrichard ("Leaving") 17:11:00 --- part: nanstm left #forth 17:12:39 Quartus, Quartus_, you (still) around? 17:15:46 --- join: Raystm2 (n=NanRay@adsl-69-149-58-83.dsl.rcsntx.swbell.net) joined #forth 17:16:41 hi Raystm2 17:16:45 --- join: vatic (n=chatzill@ool-45740b1c.dyn.optonline.net) joined #forth 17:22:36 im reading a tutorial about forth and i see some lines begin with "ok" but i don't see any description of that. Is it just the prompt to a repl or am i missing something fundamental? 17:22:36 hi 17:22:55 ok is a prompt 17:22:55 fnord123: ok is just the prompt 17:27:14 hi jcwren 17:27:16 : ok ." ok" cr ; 17:27:30 whassup? 17:27:34 --- nick: jcwren -> jcw 17:28:06 --- nick: jcw -> jcw_ 17:28:18 Apparently I have forgotten my PW. 17:28:22 anyway. 17:28:26 : aa throw ; 17:28:37 : bb 1 ['] aa catch . cr ; 17:28:44 What's the expected behavior for that? 17:30:47 That'd print a 1, I think. Is this just a thought-exercise? 17:31:04 No. I know what gforth does, but mine gets... unhappy. 17:31:15 I'm not sure what the expected behavior is for sure. 17:31:20 To print a 1. 17:31:56 And that would be because the throw consumes the 1, but the stack recovery leaves the 1 there anyway? 17:32:01 1 ['] aa catch is equivalent to 1 aa, so 1 throw. Because it's a catch, the throw code is passed back to catch, and that's what prints. 17:32:24 Throw doesn't consume the 1, it throws the 1. 17:33:12 For mine, : aa 1 throw ; : bb ['] aa catch . cr ; works as expected (as it does in gforth). And I had another case that works, but it's on my laptop, which is still in it's bag. It's only this one case that fries it. 17:33:45 It shouldn't. CATCH is equivalent to execute 0 unless there's a throw, in which case it's equivalent to execute . 17:34:27 so if : aa ; : bb 1 ['] aa execute . ; prints a 1, then so should : aa 1 throw ; : bb 1 ['] aa catch . ; 17:34:28 Whenever I/we were writing it, we must have missed that as a test case. I thought I had it work purrfectly. 17:36:41 What do you get from : aa ; : bb 1 ['] aa catch . . ; 17:37:04 0 1 17:37:12 That's right. 17:37:23 What do you get from : aa 5 throw ; : bb 1 ['] aa catch . ; 17:37:40 er... catch . . 17:37:46 I was just gonna ask... 17:37:53 5 1 17:38:13 Ok, so I have no clue why your earlier example doesn't work. 17:38:22 Me neither. Yet. 17:38:50 What happens? Crash? 17:39:47 Well, as you know (and deride me for), mine does type checking. And when the internal code goes to pop one the parameter to recover the stack, it finds it's the wrong type. 17:40:15 Ah. 17:41:45 you're keeping the exception frames somewhere other than the data stack, I presume? 17:41:53 No. 17:41:57 Do that. 17:42:20 The example implementation in the standard appendix uses the return stack. 17:42:24 That's the most common approach. 17:42:41 Sorry, I spoke incorrectly. 17:42:43 I do use the return stack. 17:43:03 so catch doesn't leave anything on the data stack when it calls the xt? 17:43:47 Correct. 17:44:20 Ok. So perhaps your THROW is more complex than it needs to be. It should restore the exception frame before pushing the throw code on the data stack. 17:46:08 The problem seems to be that it's not finding the 0 on the stack that catch pushes. 17:46:47 catch shouldn't be pushing a 0 onto the stack. 17:47:00 Not before the execute, anyway. 17:47:15 It should only put one there afterward, if the xt returns without a throw. 17:48:02 It's not doing it before the execute. 17:48:17 --- quit: Raystm2 ("I've embarrassed my self enough for one day.") 17:48:26 what do you mean by 'it' is not finding the 0 on the stack that catch pushes? 17:48:32 what is 'it'? 17:48:51 The catch code. 17:49:03 If you notice, in the reference implementation, it's doing a drop. 17:49:20 Is that drop not throwing away the 0? 17:49:28 --- join: Raystm2 (n=NanRay@adsl-69-149-58-83.dsl.rcsntx.swbell.net) joined #forth 17:49:30 I'm not looking at the reference implementation at the moment. Pushing a 0 on the stack should be the very last thing CATCH does, if the xt returned normally. 17:49:51 Ok, I brought it up. 17:49:53 You mean R> DROP ? 17:50:10 No. 17:50:16 R> SWAP >R ( saved-sp ) \ exc# on return stack 17:50:16 SP! DROP R> ( exc# ) \ restore stack 17:50:18 In throw 17:50:41 --- quit: fnord123 () 17:50:53 THROW doesn't drop anything from CATCH, because CATCH doesn't leave anything on the stack until after xt returns. 17:51:14 So what's it dropping? 17:51:33 It restores the stack, the drops. Something must be there. 17:52:39 Well, back through it starting in CATCH. What's in an exception frame? 17:55:41 (phone) 17:58:20 You could also use the reference implementation directly, from inside your Forth. It runs in Gforth, too, so you can instrument it with .s at the appropriate points to see what's happening. 17:58:42 --- join: snowrichard (n=richard@12.18.108.162) joined #forth 18:04:25 hi 18:08:14 ho snowrichard 18:11:19 hi Quartus 18:11:46 Using the reference implementation under gforth prints '1 -1208217608' 18:11:50 Under mine, I get 0 1 18:13:16 Doesn't here. What test are you running? 18:13:24 : aa throw2 ; 18:13:24 : bb 1 ['] aa catch2 . . cr ; 18:13:34 I named the reference versions to throw2/catch2 18:13:49 You can't . . there. 18:13:51 Just . 18:14:00 ah 18:14:20 Why don't I get an underflow, then? 18:14:22 Should just be a 1. 18:14:36 jcw_, I am not the Amazing Kreskin, I can't see your implementation from here :) 18:14:53 read through the envelope you are holding against your head ;) 18:14:54 Why don't get I get an underflow in gforth? 18:15:23 Because you're not underflowing the stack. 18:15:52 Obviously I'm missing something here. What's on the stack then? 18:15:55 The stack depth is maintained, but the stack contents may differ. So you're getting a random value back, it's meaningless to print it. 18:16:02 AH 18:16:26 You should, however, be getting a new 1 back off the catch. And in gforth, you are. 18:18:10 --- mode: ChanServ set +o I440r 18:18:33 --- quit: snowrichard ("Leaving") 18:33:04 I think my rp! broke. 18:33:16 Stop using it as a screwdriver! 18:33:29 But it says Craftsman on it! 18:34:03 --- join: zpg (n=user@user-544481c1.lns5-c10.dsl.pol.co.uk) joined #forth 18:34:10 If it says Libby's Libby's Libby's on the label label label 18:34:18 evening. 18:34:27 hey 18:34:36 hi Quartus, how's it going? 18:34:46 Well.You? 18:35:10 Not bad at all thanks. Turned out that the getting up on time didn't go so well, but that aside... :) 18:35:18 --- join: crest_ (n=crest@p54895AA4.dip.t-dialin.net) joined #forth 18:35:37 Happens. 18:35:57 Indeed. 18:45:13 --- quit: Crest (Read error: 110 (Connection timed out)) 18:49:44 So in the : aa throw ; : bb 5 ['] aa catch . cr ;, after it prints 5, there's still a value on the stack. This is what used to be the 5 that was there, that will happen to be whatever? 18:50:01 Right. 18:50:10 OK. It is fix0r3d. 18:50:20 very good. 18:50:26 *wags tail* 18:50:33 Disturbing. 18:50:49 Hey, on the intarweb, no one knows you're a dog. 18:51:09 Only if you don't wag, because that GIVES IT AWAY. 18:51:17 busted. 18:51:23 I mean... *woof* 18:51:24 * zpg chuckles 18:55:00 ugh ok, im a heretic but i HATE catch and throw 18:55:49 And your more improved solution is? 18:56:09 Please elaborate. 18:56:30 swing/pitch? 18:56:32 i have a message passing mechanism in isforth that can be used to do catch/throw type deals 18:56:40 That 'semaphore' dealie of yours, right? 18:56:43 but its more versatile 18:56:45 ya 18:56:59 That's apples and oranges. Yours is decidedly not a non-local return exception facility. 18:57:05 i can have a NON fatal throw that can be caught by as many words as need to see it 18:57:20 define a local return ? 18:57:35 define a NON local return 18:58:04 the semaphore does not need to return at all. your catcher can abort 18:58:06 a non-local return is a return that's non-local. Like setjmp. 18:58:19 still lost me 18:58:21 lol 18:58:36 but i think this is splitting hairs anyway 18:58:38 hang on, I've been interrupted. 18:58:43 k lol 18:58:46 service the interrupt 19:00:10 catch sets up an exception frame that a subsequent throw can restore, no matter how deep it happens to be. It rolls back the stack pointers. 19:00:39 So that's what 'non-local return' means. 19:00:48 wouldnt be difficult to add that facility to my code 19:01:08 but i see no point in having a LAYERED exception handling facility 19:01:10 I'm pretty familiar with your semaphore setup; it's really a completely different thing. 19:01:17 yup 19:01:36 i think its better 19:01:37 lol 19:01:40 tho i am biased 19:01:49 It's not in competition; it serves a different puprose. 19:01:52 i just do not like catch/throw 19:02:02 it can serve the same purpose 19:02:11 its not restricted to that one purpose however 19:02:43 Catch/throw isn't restricted to one purpose, either. It's not necessarily just for error conditions. I'd need you to show me how you could use your semaphore code to effect a non-local return, as I'm just not seeing it. 19:03:17 soon as you give me a valid reason for having such a layer cake of exception handlers 19:03:24 thats the part i most definatly do not get 19:03:44 I have to give you a reason for catch/throw to exist before you'll stand up for your claim that your code can do the same thing? 19:04:00 no 19:04:38 why have a mechanism that can throw in the core back to a mid layer which can throw back to a higher layer 19:04:47 why have a layered mechanism 19:05:03 an exception is an exception. why complicate things by scattering the handlers all over the place 19:05:11 no 19:05:15 thats not quite what i mean 19:05:33 you can only have ONE handler for a given exception unless that exception also throws 19:05:37 back up a level 19:05:45 I don't see why I have to jump through any hoops in order for you to back your own claim, but anyway -- it lets you decided at what level you want to manage exceptions. You could do it all from top-level code, or handle certain exceptions at a different level, as best fits. 19:06:11 i can do that 19:06:21 i can also have multiple catchers for a single throw 19:06:29 its not the scatter i dont understand 19:06:32 its the layers 19:06:51 core throws because its a critical error in the core. but for the mid level catcher its not a fatal error 19:06:56 so it just keeps on trucking 19:07:06 I'm not sure what you mean by 'core' here. 19:07:09 but if it sees an error thats fatal to IT it throws higher up the chain 19:07:21 an contrived example 19:07:33 Yes, that's how catch/throw works. If a given catch doesn't have anything useful to with a returned throw code, it can re-throw it. 19:07:42 you have a serial recieve routine. if it gets part way thru recieveing but never gets the whole data it throws 19:08:03 but for the message processor thats not fatakl 19:08:05 fatal 19:08:10 its just "no message recieved yet" 19:08:20 but if a bad message comes through thats a fatal error 19:08:22 layer cake 19:08:43 thats a contrived example but any example i can come up with is contrived 19:08:43 That'd be a really peculiar way to code a serial receive routine. 19:08:56 i said it was contrived. 19:09:06 as an example of the layer cake catch throw sets up 19:09:19 Well, ok. Suppose you've got a submodule that writes a file. It runs into a file error, so it throws that. 19:09:35 If it's a really simple program, you'd let that throw come back up to the console and report the error. 19:09:54 If you want, though, you could use catch to trap the exception and take a more appropriate action. 19:10:19 the so why do you need local return for that 19:10:24 Notice I'm not using any baked-good metaphors, so if it's confusing let me know, I'll start talking about pastries or something. :) 19:10:28 my method can do exactly the same thing 19:11:23 The file-writing routine may be called from more than one place, so you want to catch the throw in the specific caller of the routine. Or there may be a level of your code at which it is best to handle and retry specifically for the throw in question; that may not be the top level of the code (probably never is). 19:14:12 btw Quartus, i have another question regarding your list code. say i had a list at the top of the stack, and wanted to create a new list from elements of it. perhaps re-ordered according to a sort routine, perhaps just 'elements 1, 5, 9' 19:14:38 zpg, you'd cdr to the elements you want, and cons the cars of those elements into a new list. 19:14:50 i'm just wondering how one would go about elegantly accessing contents of the original list and manage the stack. 19:15:04 The list never lives on the stack; just a pointer to its first element. 19:16:04 hmm ok, so if we wanted elements 1,3,5 would we retrieve these (perhaps with 1 3 5 on the stack) would we push the results to the list, then use these to create a new list? 19:16:12 I am not a LISP person, so I will ask this: Why do you want to force your data structures into a list? 19:16:43 oh it's academic really, Quartus showed me a very concise list implementation recently. 19:17:10 zpg, you're using terminology apparently at random, there. Are you looking for some generic facility where you'd type 1 3 5 3 mylist1 mylist2 copy-list-items or something? 19:17:16 Yea, I saw that. So you're not actually trying to force Forth to be LISP-like, this is more of an implementation exercise? 19:18:35 I looked at LISP many years ago, and I just couldn't make it fit anything I was trying to do at the time. Conceptually, it looks interesting. But other than writing emacs macros (and I don't use/like emacs), I don't have much practical use for it. 19:18:49 Quartus: something like that, yeah. i'm just trying to picture accessing a list at the top of the stack, then managing the retrieved elements and a new list. 19:19:18 zpg, you'll do better to have a specific requirement in mind, and code to that, as opposed to trying to solve an non-specific general case. 19:19:30 jcw_: yeah, i'm a lisper, so this was a nice way to look into Forth. No, I'm not discussing 'forcing', it's just an interesting topic. 19:20:01 Lists are jim-dandy for certain things. I'd hate to be restricted to only lists, though. Even Lisp has vectors and so on. 19:20:17 Quartus: yeah ok, let's say we want to create a new list formed of only the odd elements of the list sitting on the top of the stack. 19:20:56 that seems a pretty simple exercise 19:21:15 zpg, how I'd approach that would depend entirely on the application. One easy way would be to copy the list elements to a temporary array, and then create a new list from the selected array elements. Another would be to walk the list, and cons the elements that meet whatever criteria to a new list. 19:22:16 I was thinking of the latter here (the array implementation sounds neat, but i'm not looking to solve the problem external to lists really, just see if there's a neat way to handle it) 19:22:35 if we're consing the elements to a new list, i'm picturing a mess of a stack. 19:22:55 generically walking a list is : walk @ begin dup while do-something cdr repeat drop ; 19:23:35 what is cdr ? 19:23:38 I don't see why. I'd put the second stack pointer on the return stack, and fetch and cons to it each time it is needed. 19:23:40 oh ok, so you'd leave the relevant elements on the stack if they satisfy our condition (say, odd) 19:23:42 I440r, lisp word. 19:24:03 I440r: 'rest of list'. common lisp has 'first' and 'last' which are the same as 'car' and 'cdr' 19:24:04 http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/car---cdr.html I440r 19:24:06 zpg, no, I absolutely would not use the stack to dump all the elements. I'd cons them one at a time as they met my condition to a new list. 19:24:28 Quartus: but i'm not seeing how you can walk list-a and cdr to list-b 19:24:30 :) 19:24:46 Again, the stack is not the solution for everything. You do not want to extract data, fill the stack with it, and then drain it somewhere else. Not if there's any other solution. 19:25:23 The origins of the names for car and cdr, on the other hand, are esoteric: car is an acronym from the phrase `Contents of the Address part of the Register'; and cdr (pronounced `could-er') is an acronym from the phrase `Contents of the Decrement part of the Register'. 19:25:55 Ok, so I'm not quite following how you'd get the data from list-1 to -2 then, given you're not dumping/fetching (I did guess this wasn't a solution, my proposal was -- 'eh? surely not this ugly monstrosity?') 19:26:08 This is not going to work, because I'm not working with the actual code, but it might give you a general idea: copy ( oldlist newlist -- ) >r @ begin dup while car r@ @ cons r@ ! cdr repeat drop r> drop ; 19:26:41 Is r@ pronounced "arr-at" or "rat"? 19:26:52 so effectively I'm keeping the newlist pointer on the return stack, pulling it off and consing a new element to it each time through. I'd factor that process into 'add-node'. 19:27:07 r-fetch 19:27:16 and what's >r ? 19:27:18 b-o-r-i-n-g 19:27:19 to-r 19:27:36 hmm ok, i'd need to read up on the words you're using to follow the code properly. 19:27:36 I like rat. 19:27:51 @ is not at, it's fetch. 19:28:35 zpg, don't strain yourself to decipher that, as I can guarantee it's non-working. I'll write a proper copy-list later on. 19:29:06 Ok. 19:29:12 http://www.99-bottles-of-beer.net/language-lisp-361.html 19:30:03 That's an ugly piece of code, ain't it. 19:30:14 Indeed. 19:30:29 Quartus: do you see where I'm coming from btw? 19:30:59 zpg, yes, but you're also trying to solve general cases. How you'd do it in a given application will depend largely on your needs at that time. 19:31:56 indeed. this was an abstract question raised in a cafe. 19:32:01 I can't think of any real-world situation in which I'd need to be keeping data in a linked-list wherein I'd also want to move all the odd-numbered elements into another list. 19:32:14 I completely do not understand all the ~~ business in that code. 19:32:20 nor do I, jcw 19:32:47 zpg, on the other hand, I found the linked-lists a very handy and simple way to build a straightforward associative-array facility. So it's horses for courses. 19:33:58 * zpg nods 19:34:20 I guess in Lisp, everything's list based. You check membership of lists, make sublists for special cases, construct lists as data, as functions, etc. 19:34:29 If I were dealing with runs of integers, for whatever reason, I'd keep them in a one-dimensional array. That's a vector, in Lisp. 19:34:51 The question came from that background, but in a Forth - how to manipulate the elements of two lists whose addresses are on the stack. 19:35:00 swap :) 19:35:07 heh 19:35:11 yes, I don't just hack Lisp -- arrays are all too familiar. 19:35:16 well, understand that my linked lists are just that -- my linked lists. You could implement them a dozen ways. That was the simplest one I found. 19:36:04 sure. 19:36:34 So I wouldn't start any new application thinking "Well, I've got linked lists, how can I solve all my problems using just those?" 19:37:13 oh sure, that's not the case. 19:37:41 --- quit: erider ("I don't sleep because sleep is the cousin of death!") 19:38:05 Swiss Army Forth. 19:38:55 I'm thinking in terms of the logistics of how one would use that code, and was very interested by how you went about implementing it. 19:39:19 I would have to implement it to show you. :) I don't usually solve problems before I have the problem to solve. 19:39:45 heh, with good reason :) 19:41:17 I'm doing up a copy-list now. 19:43:56 nice! 19:44:27 I'm getting interrupted though, so don't time me. 19:44:37 no worries, other things happening here too. 19:56:51 zpg: http://forth.pastebin.ca/189479 19:58:06 Copies the list in reverse order. 20:00:57 list2 contains 7 6 5 then? 20:08:27 Give it a try. 20:08:36 sorry, was watching the news. 20:08:41 no worries. 20:11:20 quartus.forth:31: Address alignment exception 20:11:20 5 list1 add-node 20:11:42 I have no idea what your setup contains. Here it runs. 20:12:14 Did you take my add-node from that paste, or are you using some other one? 20:12:21 the old one. 20:12:54 oh cool, works now. 20:12:57 excellent! 20:19:44 --- quit: vatic (Remote closed the connection) 20:20:26 so add-node is essentially a push operation, push to list. when you copy the list, you're still pushing, so you'll end up with a reverse order. 20:20:49 It's not a push operation. Pushing is something you do to a stack. It's a copy. It adds to the head of the list. 20:21:10 well, push to list. 20:21:13 Everything is not a stack! 20:21:18 you can push to lists. 20:21:35 my lisp library is full of it. 20:21:44 but i'm stepping on Forth terminology evidently. 20:22:23 You could say you were pushing data into a file instead of appending, then, or pushing two numbers together instead of adding them, or pushing a number into a memory location. I think a broader vocabulary is more accurate and useful. 20:22:56 no no. when you have a list (2 3 4) and want it to begin with 1, you say (push 1 ' (2 3 4)) in lisp. 20:23:27 though that's a stupid example. 20:23:43 if X is the list '(2 3 4), then you'd say (push 1 X) 20:24:01 that's like saying (setq X (cons 1 X)) -- i.e., set X to a new list built from the cons of 1 and X 20:24:07 A clumsy use of the verb 'push', but ok. 20:24:45 yeah, it's used in list processing. push is a macro that expands to the above assignment expression. 20:25:04 It's used in lisp, you mean. 20:25:19 I've seen it elsewhere too. 20:25:59 unsurpisingly, you can pop from a list in lisp, meaning, return the head of the list and set the list to its tail. 20:26:07 also a macro. 20:26:24 Really lousy naming. There's no stack in Lisp, so no confusion, I guess. In Forth there's a stack. 20:27:09 yes, i can see your point. 20:27:36 since it's all lists in lisp (with other stuff on the side) you can use a list as a stack if it suits the function. 20:27:44 A list makes for a really clumsy stack, though you could use it for one. 20:28:27 I'm not sure it's clumsy conceptually or programmatically, but hey. 20:29:46 I'm sure. It's slower and takes more memory. 20:29:52 of course. 20:30:05 Hence my use of the word 'clumsy'. 20:30:08 * zpg nods 20:49:49 --- join: snowrichard (n=richard@12.18.108.162) joined #forth 20:50:48 night all. 20:50:48 --- quit: zpg ("ERC Version 5.1.3 (IRC client for Emacs)") 23:59:39 --- join: arke_ (n=Chris@pD9E05C64.dip.t-dialin.net) joined #forth 23:59:59 --- log: ended forth/06.10.02