00:00:00 --- log: started forth/09.04.23 00:06:02 --- join: proteusguy__ (n=proteusg@61.7.144.97) joined #forth 00:07:41 how would i get access to the values typed before a word? 00:07:42 ie 00:07:47 1 2 3 4 5 reverse 00:08:03 the word reverse would then put the numbers in reverse order on the stack. 00:08:15 i'm not sure how to get access to them.. 00:24:23 --- quit: sunwukong (Remote closed the connection) 00:24:59 --- join: sunwukong (n=vukung@125-14-81-177.rev.home.ne.jp) joined #forth 00:28:49 nvm 00:28:50 i got it 00:29:02 kinda silly when you aren't looking at the big picture 02:19:27 --- quit: nighty__ (Read error: 104 (Connection reset by peer)) 02:46:35 --- join: cataska (n=cataska@210.64.6.233) joined #forth 02:51:46 --- quit: proteusguy__ (Read error: 110 (Connection timed out)) 02:54:13 --- join: proteusguy__ (n=proteusg@61.7.144.97) joined #forth 03:50:08 --- quit: mr_uggla (Read error: 54 (Connection reset by peer)) 04:45:34 --- join: growler_ (n=growler@62.93.79.65) joined #forth 04:54:04 --- quit: TreyB (Read error: 113 (No route to host)) 05:26:38 --- quit: proteusguy__ (Read error: 110 (Connection timed out)) 05:26:51 --- join: proteusguy_ (n=proteusg@61.7.144.97) joined #forth 06:01:49 --- quit: sunwukong ("bye") 06:03:27 --- quit: Al2O3 (Remote closed the connection) 06:40:14 --- quit: growler_ ("Leaving") 06:40:18 --- part: aerosuidae left #forth 06:43:49 --- join: growler_ (n=growler@62.93.79.65) joined #forth 07:00:22 --- quit: xjrn (Remote closed the connection) 07:46:55 --- join: proteusguy__ (n=proteusg@61.7.144.97) joined #forth 07:48:12 --- quit: proteusguy_ (Read error: 110 (Connection timed out)) 08:29:36 --- quit: gogonkt ("leaving") 08:33:21 --- join: gogonkt`` (n=info@58.248.188.162) joined #forth 08:40:40 --- join: gogonkt`1 (n=info@58.248.188.159) joined #forth 08:48:14 --- join: Al2O3 (n=Al2O3@c-98-245-177-23.hsd1.co.comcast.net) joined #forth 09:04:44 --- quit: gogonkt`` (Success) 09:22:48 --- quit: Al2O3 (Connection timed out) 09:33:00 --- quit: proteusguy__ (Read error: 60 (Operation timed out)) 09:45:25 --- join: proteusguy__ (n=proteusg@61.7.144.97) joined #forth 11:23:25 --- join: Al2O3 (n=Al2O3@70-58-2-220.hlrn.qwest.net) joined #forth 12:15:33 --- join: proteusguy_ (n=proteusg@61.7.144.97) joined #forth 12:16:45 --- quit: proteusguy__ (Read error: 110 (Connection timed out)) 12:20:36 hi 12:20:45 is anyone active in this chan at the moment? 12:20:52 Just you, I think. 12:20:58 haha well then.. 12:21:28 quick question, how could i move the last number in the stack to the front of the stack? 12:21:39 say, with four numbers in the stack total? 12:21:51 right now i have 12:21:53 1 4 3 2 12:22:00 but i'm not sure how to move the 1 12:23:42 You shouldn't be doing that. :) 12:24:00 DEPTH ROLL should do it, but tathi is right. 12:25:33 Well, if you have some reason to do it in a specific circumstance... 12:26:12 But in general treating the stack as a data structure is bad. 12:29:08 Hey, that's curious: gforth puts garbage on the TOS after: 1 4 3 2 depth roll .s 12:29:13 yes 12:29:41 depth roll is one too many 12:29:49 I get a stack underflow exception here. 12:29:59 same 12:30:05 Oh yeah. Dur. 12:30:06 well, it's actually a lab 12:30:12 i'm working on 12:30:13 1 4 3 2 depth 1 - roll .s 12:30:18 but i got the reversal of 1 2 3 4 12:30:20 Or 1-, if you've got it. 12:30:23 by useing 2swap 12:30:43 so is the problem to reverse an arbitrary number of elements? 12:31:04 yep 12:31:17 An arbitrary number of elements on the stack? 12:31:35 i spent alot of time learning forth last night and i think doing this recursively with a variable would be the easiest thing todo 12:31:37 yep 12:31:45 ie: the call would be 12:31:52 1 2 3 4 5 6 reverse 12:31:59 hmm, possibly. 12:32:01 theres no output 12:32:06 then when you print the stack 12:32:12 it should be something like 12:32:18 .s <6> 6 5 4 3 2 1 12:32:29 The trouble that I see is that ROLL will pull an element up from the depths, but there's no good way to put one back down. 12:32:45 tathi is right: you shouldn't be doing this, and your course shouldn't be teaching you that this is a good thing to do :( 12:32:52 : \ 12:33:02 Bah, whatever. 12:33:04 i'll mention it to my prof. when i see him on monday 12:33:07 :) 12:33:20 If it's a problem they're setting you, you might as well have fun with it. 12:33:38 anywho i must be going now.. Class at 4PM.. 12:33:48 :) 12:33:48 afk 12:33:55 It's just that doing that sort of thing has no place in good forth code. :) 12:34:03 Sounds like an academic exercise to me for sure. Even knowing how to do such a thing seems dangerous to me, though. 12:34:15 If you know how to do it you might use it in a pinch. :-( 12:34:21 hehe 12:34:47 If you found yourself tempted to do such a thing then something probably went wrong much earlier in the planning of the application. 12:35:30 KipIngram, there's an argument to be made that the correct way of handling such a user request is not to attempt to forbid the knowledge, but merely to take advisory action when it is used. 12:35:56 Perhaps an electrified keyboard could be employed as a suitable tool for the output of the advice. 12:36:54 Oops, I'm an idiot. reverse is dead simple. 12:36:59 ;-) 12:37:50 Sssh! 12:38:06 If I'd known it was homework I wouldn't have piped up so quickly with code :) 12:38:15 Yeah, I wouldn't want to tempt KipIngram :) 12:38:25 Oh, homework. Yeah. 12:38:30 I figured it had to be that. 12:59:41 --- join: kar8nga (n=kar8nga@a-168.vc-graz.ac.at) joined #forth 13:44:02 --- join: andrewSC1 (n=andrew@northdakota.rit.edu) joined #forth 13:44:40 hi all 13:44:42 :) 13:44:55 so is this really as easy as i think? 13:45:07 also, my apologies with the nick copy 13:45:23 i'm in class atm and my desktop back home is still logged in.. 13:47:13 well actually 13:47:34 how could i swap more than six elements in the stack? 13:47:46 using 2swap limits me to six.. i think. 13:51:08 --- quit: kar8nga (Remote closed the connection) 13:52:39 --- quit: Quartus` (Read error: 110 (Connection timed out)) 13:55:51 yes 13:56:04 i've only been able to swap the first six elements in the stack.. 14:03:48 --- join: JasonPx (n=Jason@ipanema.parkpointrit.com) joined #forth 14:05:31 --- quit: qFox (Read error: 104 (Connection reset by peer)) 14:08:08 how would i grab the last element in the stack and put it on the top? 14:09:33 dup 14:10:58 is there a way to reverse abcde to edcba without using variable? 14:12:28 hmm seems like i can just tuck and drop 14:12:46 hahah 14:12:56 JasonPx... 14:13:01 again we meet.. 14:13:05 actually nvm 14:13:15 JasonPx, try doing more than six elements 14:13:20 tell me how it works out 14:13:25 yea it wont work 14:13:27 haha 14:13:30 i just notice 14:13:32 yep 14:13:39 emmmmmm hmm 14:18:16 andrewSC1: i dont think it's possible with just plain loops of stack operation 14:18:31 it is 14:18:41 it has to be 14:18:54 and you can't use variables. 14:18:54 well you can but Steele will frown upon it 14:19:10 and recursion is possible but not reccomended 14:19:17 seeing as you can't really use variables 14:19:23 or shouldn't* 14:32:55 --- quit: proteusguy_ (Read error: 60 (Operation timed out)) 14:36:37 --- quit: andrewSC1 ("Leaving") 14:53:39 --- join: TreyB (n=trey@74.203.168.157) joined #forth 14:53:47 --- join: proteusguy_ (n=proteusg@61.7.144.97) joined #forth 15:03:01 andrewSC: did you use PICK ? 15:03:12 yes and no 15:03:15 hahahaha 15:03:18 mainly yes 15:03:20 ok 15:03:26 i think i need to use pick 15:03:33 i haven't finished writing it yet though.. 15:03:36 because i cant think of anyway of doing it without pick 15:03:38 just got back from class 15:03:41 o i c 15:12:43 there's ROLL also 15:15:19 Or you could check the length of the stack, dynmically construct a straight-line word that abuses the return stack... but that's crazy talk. 15:16:35 how do you use roll? 15:16:46 i've googled this and i don't get much... 15:17:15 It's homework, andrewSC! You shouldn't be trying to get Google to do your homework for you. 15:17:20 haha 15:17:38 well, look at it this way.. I don't understand how to use a defined word in forth 15:17:47 just type it in :) 15:17:51 if it's something i might be able to use shouldn't i try and understand it 15:17:57 i did i get a stack underflow.. 15:17:57 lol 15:18:09 i also tried roll -1 15:18:14 1 roll -1 15:18:15 etc 15:18:30 nope. Stack-based language -- put the parameters on the stack first 15:18:55 mhmm 15:20:35 play with it. 1 2 3 4 1 pick .s 15:20:40 or 2 pick, 2 roll, 3 roll, whatever 15:20:45 you'll get the idea 15:22:10 andrewSC, you may find this useful: http://forth.sourceforge.net/standard/fst83/ It's very dated, but it's a good demonstration of just how small a Forth really needs to be in order to merit the name. 15:23:47 Starting Forth is also an excellent tutorial: http://www.forth.com/starting-forth/ 15:23:48 intresting... 15:23:57 (though I can't find the swap dragon!) 15:26:05 both links are very good! 15:26:10 thank you for the share :) 15:36:23 awesome 15:36:26 got it working... 15:36:34 super easy once i figured out the iteration 15:36:38 thanks guys 16:06:33 hmmmm 16:06:55 does .s return all the elements on the stack or just the first 9? 16:07:03 wait 16:07:06 stupid question nvm 16:08:11 why does .s print 9 elements at a time? 16:09:44 i guess they print at some limit.. and 9 was the magic #. you can define a word to print all the items in the stack :) 16:10:22 great 16:10:24 lol 16:10:24 i guess they want to print the # of items at a certain limit* 16:10:30 mhmm 16:10:39 btw gnomon, http://www.forth.com/starting-forth/sf2/sf2.html 16:10:42 swap dragons! 16:10:42 lol 16:19:04 gforth only prints the first 9 16:19:20 Other systems do differently 16:20:51 i see 16:21:04 can you redefine the word bye? 16:21:05 thanks for the clarification tathi 16:21:08 "bye" ? 16:21:44 ":noname ... ; is bye" works in gforth for m 16:21:44 e 16:34:46 Oh nice! Thanks, andrewSC! For some reason I thought he appeared earlier than chapter 2. 16:43:20 ehird: it does? 16:43:28 For me, yes. 16:43:55 Huh. I get some sort of error if I try executing bye after doing that. 16:44:02 Seems like it's not always even the same one. 16:44:05 Interesting 16:48:01 tathi: what error? 16:48:20 hmm 16:48:22 invalid memory address 16:48:24 interesting 16:48:25 me too 17:06:29 I got illegal instruction once also 17:06:38 Makes sense, since bye isn't deferred 17:06:59 Presumably `is`, like most things in Forth, just doesn't check. 17:07:00 well 17:07:04 : bye 2 ; works in gforth :-P 17:07:12 oh, sure, you can redefine it. 17:07:20 00:21 JasonPx: can you redefine the word bye? 17:07:21 was the q 17:07:44 ehird: didn't bother.. was just asking :\ 17:07:50 :-) 17:07:51 yeah. I was just startled by you saying that `is bye` worked. 17:07:57 I thought it did 17:08:04 as I thought the error was in my redefined code 17:08:17 but yeah -- : bye ." hello world" cr ; redefined bye ok 17:08:18 bye hello world 17:08:19 ok works fine. 17:20:54 hey guys im working on vector execution and i try ' bye pointer ! based on http://home.iae.nl/users/mhx/sf9/sf9.html 17:20:58 and it doesnt work - - 17:25:53 andrewSC: for eval.fs, do we just create simple functions ? 17:31:45 what does it do instead of working? 17:32:07 --- join: proteusguy__ (n=proteusg@61.7.144.97) joined #forth 17:34:29 --- quit: proteusguy_ (Read error: 110 (Connection timed out)) 17:56:45 --- join: nighty__ (n=nighty@210.188.173.245) joined #forth 18:00:05 --- quit: mjonsson (Client Quit) 18:05:42 --- quit: Al2O3 () 18:49:07 --- quit: nighty__ (Client Quit) 19:19:29 Anybody that's on right now ever done an FPGA-based Forth hardware processor? 19:23:33 --- join: slava (n=slava@li13-154.members.linode.com) joined #forth 19:23:33 --- mode: ChanServ set +o slava 19:26:55 --- join: Quadresce` (n=quad@unaffiliated/quadrescence) joined #forth 19:45:47 --- join: nighty__ (n=nighty@210.188.173.245) joined #forth 20:36:30 --- quit: tgunr (Connection timed out) 21:00:01 --- nick: Elly -> Elly|silent 21:13:44 --- quit: JasonPx ("Leaving") 21:21:22 hi everybody! 21:57:20 :( 22:00:36 hi 22:01:34 is it possible to create an array of functions? 22:01:37 like say i have 22:01:43 : a ." a " ; 22:01:46 oops 22:01:59 : a ( -- ) ." a " ; 22:02:00 yes 22:02:05 and then before that 22:02:16 create alpha a , 22:03:47 i'm not too sure how to store the functions in an array.. 22:05:55 You just did 22:06:06 pretty much 22:06:16 An array of 1 cell containing an XT for the word you want to execute 22:06:18 except maybe you meant ' a , 22:06:26 hmmm 22:06:28 Yeah 22:06:34 let me try that 22:06:38 So... create alpha ' a , ' b , ' c , 22:06:41 There, array of 3 words 22:06:46 ahh i was forgetting the ticks 22:08:59 that and i placed the array at the top of the file 22:09:11 instead of after all the little functions i wrote 22:16:22 Forth is rad, eh? RAD! 22:16:49 it's excellent. 22:16:54 => 22:17:04 --- nick: gogonkt`1 -> gogonkt 22:17:15 :D 22:26:13 how about this. 22:26:20 i have one integer on the stack 22:26:20 --- quit: proteusguy__ (Read error: 110 (Connection timed out)) 22:26:28 i want to do two comparisons 22:26:30 ie: 22:26:38 -1 > 22:26:48 24 < 22:26:54 i can't use and can i? 22:27:00 perhaps dup? 22:28:52 --- join: proteusguy__ (n=proteusg@61.7.144.97) joined #forth 22:29:15 great. 22:34:49 dup -1 > swap 24 < and 22:42:07 yes yes 22:42:13 thanks slava 22:42:21 :) 22:42:26 how about this one.. 22:42:33 i have 26 values in my array 22:42:41 i want to access the 23rd one 22:42:53 the array name is alphabet 22:42:59 right now im at 22:43:18 alphabet cell+ @ 22:43:26 which stores the address to the function on the stack 22:43:33 then i call execute 22:43:40 which executes the function 22:43:50 however, i'm not sure how to get to the 23rd one .. lol 22:44:11 --- join: qFox (i=C00K13S@132pc222.sshunet.nl) joined #forth 23:01:55 --- join: sunwukong (n=vukung@ortros.den.rcast.u-tokyo.ac.jp) joined #forth 23:04:05 nvm got it 23:04:13 cells 23:04:17 is the key word here ;) 23:08:11 I must say forth is quite unreal. 23:08:32 doesn't take much to understand it and at the same time it's hella powerful 23:08:32 :D 23:09:01 forth quit diferent than others 23:09:09 Definitely preferred over scheme ;) 23:09:14 indeed 23:09:43 more closely to hardware 23:10:36 oh yeah... 23:10:53 i'm currently writing MIPS ASM so i know all about that hardware level.... 23:10:54 haha 23:11:29 nice 23:12:15 yep 23:14:26 how many bytes are in a cell? 23:14:58 or is the size of a cell of arbitrary value (ie: whatever is in it determines the size) 23:15:41 8bit/16bit/32bit/64bit 23:15:55 mhmm 23:16:15 x2 for double cell 23:17:05 which one u used? 23:17:47 32bit 23:22:36 --- quit: Quadresce` (Remote closed the connection) 23:39:50 “Knock, knock.” 23:39:50 “Who’s there?” 23:39:50 very long pause…. 23:39:50 “Java.” 23:39:53 hahah 23:39:58 thought i would share.. 23:42:10 .... 23:43:54 hahah 23:44:09 makes me chuckle 23:59:59 --- log: ended forth/09.04.23