00:00:00 --- log: started forth/09.01.28 00:00:34 --- join: workthrick (n=mathrick@cpe.atm2-0-75314.0x50a7275a.kd4nxx18.customer.tele.dk) joined #forth 00:40:24 --- quit: nighty__ (Remote closed the connection) 00:50:38 --- join: qFox (i=C00K13S@132pc222.sshunet.nl) joined #forth 01:13:28 --- join: H4ns1 (n=Hans@p57BBA321.dip0.t-ipconnect.de) joined #forth 01:15:01 --- quit: H4ns (Nick collision from services.) 01:15:03 --- nick: H4ns1 -> H4ns 02:09:05 --- quit: workthrick (Remote closed the connection) 02:09:40 --- join: workthrick (n=mathrick@cpe.atm2-0-75314.0x50a7275a.kd4nxx18.customer.tele.dk) joined #forth 02:14:18 --- quit: workthrick (Remote closed the connection) 02:14:56 --- join: workthrick (n=mathrick@cpe.atm2-0-75314.0x50a7275a.kd4nxx18.customer.tele.dk) joined #forth 02:22:32 --- join: I440r (n=mark4__@ip70-162-227-36.ph.ph.cox.net) joined #forth 06:35:37 --- join: _workthrick (n=mathrick@0x55529153.adsl.cybercity.dk) joined #forth 06:51:17 --- quit: workthrick (Read error: 110 (Connection timed out)) 07:22:11 --- join: Quartus` (n=Quartus`@207.245.250.61) joined #forth 07:28:41 --- quit: _workthrick (Read error: 110 (Connection timed out)) 08:08:04 --- join: tathi (n=josh@dsl-216-227-91-166.fairpoint.net) joined #forth 08:08:04 --- mode: ChanServ set +o tathi 08:13:20 --- part: X-Scale left #forth 08:24:04 --- join: aguaithefreak (n=aguai@118-169-162-186.dynamic.hinet.net) joined #forth 08:36:58 --- join: X-Scale (i=email@89.180.229.88) joined #forth 08:48:20 --- join: GeDaMo (n=gedamo@dyn-62-56-77-42.dslaccess.co.uk) joined #forth 09:09:34 --- quit: H4ns ("Leaving.") 09:40:25 --- join: GoNoGo (n=GoNoGo@cro34-3-82-236-93-215.fbx.proxad.net) joined #forth 09:55:30 --- quit: Baughn ("leaving") 10:05:58 --- join: nxt (n=nxt@77.207.25.109) joined #forth 10:25:02 So, here's a really stupid question: has anyone here implemented a string-threaded Forth? 10:26:18 I'm implementing a spreadsheet in awk as an afternoon joke and I'm looking to have cell formulas share a command syntax (and an eval subsystem) with the user interface. 10:47:14 --- quit: aguaithefreak (Read error: 60 (Operation timed out)) 10:47:21 --- join: aguaithefreak (n=aguai@118-169-168-248.dynamic.hinet.net) joined #forth 10:51:26 --- join: H4ns (n=hans@p57A0E78D.dip.t-dialin.net) joined #forth 10:57:21 --- quit: GoNoGo (Read error: 113 (No route to host)) 11:27:33 --- join: GoNoGo (n=GoNoGo@cro34-3-82-236-93-215.fbx.proxad.net) joined #forth 11:50:23 --- quit: aguaithefreak (Connection timed out) 12:09:56 --- join: impomatic (n=John@nat65.mia.three.co.uk) joined #forth 12:12:05 Hi, any idea how to make this smaller? : f 46 0 do dup 1 .r cr over + swap loop ; 1 1 f 12:14:05 Looks good to me 12:15:23 I don't understand why you're using 1 .r instead of just . 12:16:48 Because just . outputs a space after the number, at least on the system I'm using 12:17:26 but...then you're doing a CR, so you can't see it. 12:17:51 I guess if you're sending the output to a file you could tell... 12:18:21 or if the values were being displayed as far right as possible. 12:18:29 or within some window 12:18:37 I thought I'd have a go at solving the code golf problems in Forth - http://golf.shinh.org/p.rb?Fibonacci+Numbers 12:19:09 : fib 0 1 rot 1+ 1 do tuck + loop nip ; :) 12:20:02 ah 12:20:25 The output is checked automatically and the program didn't like the spaces 12:23:33 Thanks l440r 12:23:39 * impomatic has never seen tuck and nip before! 12:23:45 :) 12:24:10 tuck probably isnt very commonly used 12:24:16 If you're playing golf you don't need the nip 12:24:40 was that a golf joke tathi? lol i didnt get it 12:25:01 I440r: code golf -- write the shortest possible program to solve a given problem... 12:25:17 oh. doesnt matter if you clean up after 12:25:20 ya 12:25:51 i suppose if you make that definition for the new forth chips it specially doesnt matter :) 12:26:52 heh 12:33:01 Yeah...smallest I can see is ": f 46 0 do dup 0 .r cr tuck + loop ; 0 1 f" 12:33:53 er, well, that might have a fencepost error, but something like that. 12:36:12 Is it smallest in character terms or word terms? 12:36:44 could use "for" instead of "do" maybe? 12:38:47 I've never seen for in Forth either! 12:39:06 I don't think for is in the ANSI standard 12:39:29 no, but it's in most Forths. 12:39:36 Just doesn't have a consistent behavior. 12:39:47 no. thats the problem with it i guess :) 12:40:12 No reason not to use it here, probably. 12:41:05 just make sure you itterate the correct number of times :) 12:41:10 brb, making coffee 12:42:41 --- nick: mathrick -> r00t|4wheels 12:43:11 --- nick: r00t|4wheels -> mathrick 12:45:38 so is "tuck" equivalent to "dup rot"? 12:46:02 Yes 12:46:04 Or swap over 12:46:15 o, wait 12:46:32 No, it would be dup -rot 12:47:00 ya. rot lets you grab the third stack item 12:47:23 -rot puts something down there, which you don't need to do as often 12:48:01 Hmmm... 12:48:20 This works : f 46 0 do dup 1 .r cr dup rot + loop ; 0 1 f 12:50:14 i would use >r ... r> before i used -rot i think 12:50:32 yeah, it's pretty flexible about which order, since you start with 1 1 12:53:22 Even if I used tuck, that only brings it down to 43 characters 12:53:31 I can't figure out how someone did it in 37 :-/ 12:53:39 Someone did it in 37 in Forth? 12:53:45 Yes 12:53:57 Pity they don't show the listings ... or do they? 12:54:18 doesn't look like it. 12:54:44 I'd guess they used recursion in something like RetroForth where the word name is visible immediately. 12:55:08 Maybe taking advantage of the fact the 47th number would roll around and become negative? 12:56:04 Oh, I didn't notice that. 12:57:00 It doesn't seem to allow recursion 12:57:09 what doesn't? 12:57:32 The interpreter on the golf server 12:57:56 oh. Hmm. Any way to find out what Forth it is? 12:58:16 impomatic: how did you try recursion? 12:58:44 gforth 0.6.2 12:58:47 There are two forms in Forth - using the recurse keyword or the name of the word 12:58:59 : f somestuff f ; 12:59:03 name of the word won't work in gforth 12:59:09 f isn't visible until after the ; 12:59:10 That won't work in gforth 12:59:19 You'd have to use recurse 12:59:28 : f somestuff recurse ; 12:59:35 which is almost certainly longer than 46 0 do .. loop 13:00:05 impomatic, USUALLY a new forth word name is not visible until the definition is complete so you cant USUALLY do that. try : f ...... recurse ; 13:00:19 ya what he said heh 13:01:13 Response is: 13:01:13 test.for:1: Undefined word 13:01:13 : f dup 1 .r cr dup rot + f ; 0 1 f 13:01:13 Oh, thanks 13:01:21 finally completed the documentation for my kernel last nite. or rather this morning at 3 am lol 13:01:34 congratulations. :0 13:01:40 er. :) 13:01:40 impomatic, that would be an infinite loop tho 13:01:50 my shift key doesn't seem to work well lately 13:02:09 does it matter that it would loop forever? 13:02:47 yeah, they check against the output 13:02:53 so presumably it needs to stop 13:02:56 Now I'm just going to make it terminate :-) 13:03:25 dup 0> while dup 1 .r .......... recurse repeat ; 13:03:49 begin dup 0> even bleh 13:03:55 begin .... while .... repeat 13:05:53 but that might make the definition larger than the non recursive one 13:08:37 : f begin dup 1 .r cr dup rot + dup 0 < until ; 0 1 f 13:08:42 Larger :-( 13:13:20 --- join: tihonov (n=kef@kefeer2.convex.ru) joined #forth 13:19:20 thot so 13:19:25 This is even longer : f dup 1 .r cr dup rot + dup 0 > if recurse endif ; 0 1 f 13:33:43 This works but it's 48 characters :/ : f 1 2971215074 1 do dup . cr i swap +loop ; f 13:34:04 impo isnt 0> a single word? you dont need to say 0 > 13:34:22 also. if you could use isfroth you could use 0> ?: recurse noop 13:34:26 --- join: Baughn (n=svein@084202037181.customer.alfanett.no) joined #forth 13:34:26 }:) 13:34:38 which is cheaper than if/then 13:35:27 isforth even bleh i cant type 13:41:32 I've got it down to 43 13:44:51 bytes? 13:44:58 GaDaMo: is that using tuck? 13:45:06 : f 1 1 46 0 do 2dup + rot 0 .r cr loop ; f 13:45:47 pass the 1 1 46 and 0 as parameters and no need to have literals compiled in :) 13:46:04 They would still count as part of the program 13:46:21 its in SOURCE size? not object size? 13:46:25 Yes 13:46:54 oh lol 13:46:57 You have to be careful not to press enter at the end of the line when you enter it - adds two bytes :P 13:47:51 lol 13:53:24 who is winning this golf thing btw? 13:53:28 whats the record? 13:53:47 You mean in Forth? Or across all languages? 13:54:48 all 13:56:21 In this Fibonacci numbers problem it's a language called GolfScript - which sounds suspiciously domain specific :P 13:56:49 :) 13:57:16 if your allowed to invent a new language to solve the problem then i hereby invent a language called FIB 13:57:33 with only ONE function.... to calculate figonacci numbers :) 13:58:05 http://www.golfscript.com/golfscript/ 14:03:24 --- quit: tihonov ("Leaving") 14:24:36 Isn't fib one of the features of HQ9+? 14:26:54 --- quit: GeDaMo ("Leaving.") 14:27:14 Ah, no. No, it's not. 14:47:03 --- quit: GoNoGo ("ChatZilla 0.9.84 [Firefox 3.0.5/2008120122]") 14:56:05 --- quit: qFox (Read error: 104 (Connection reset by peer)) 15:06:29 --- quit: Quartus` (Read error: 110 (Connection timed out)) 15:28:26 --- quit: H4ns ("Leaving.") 16:28:26 Hehe. I'm so evil. 16:28:43 0 1 16:28:45 dup 0 .r cr tuck + dup 0< >in ! 16:29:04 it crashes when it's done, but the tester doesn't care 16:36:28 --- part: X-Scale left #forth 17:16:08 lol 17:54:21 setting >in to -1 :P~ 19:53:23 --- quit: JasonWoof ("off to bed") 20:05:36 --- quit: tathi ("leaving") 21:48:02 --- join: nighty__ (n=nighty@210.188.173.245) joined #forth 23:42:01 --- join: workthrick (n=mathrick@0x55529153.adsl.cybercity.dk) joined #forth 23:47:59 --- join: aguaithefreak (n=aguai@118-160-19-201.dynamic.hinet.net) joined #forth 23:59:59 --- log: ended forth/09.01.28