00:00:00 --- log: started retro/10.01.10 00:21:06 http://gist.github.com/271895 <- new version incorporating elements 00:22:22 my main reason for inventing elements was so that I could copy a set of three variables to a set of three fields in the vocab word. 01:46:07 --- join: virl (n=virl__@chello062178085149.1.12.vie.surfer.at) joined #retro 01:48:31 hi virl 01:48:53 hi, docl what's up? 01:49:12 Hi y'all 01:49:52 * docl has been factoring my vocab system 01:49:57 hi js4 01:51:11 I got "offended" by all the references to found and tib in the main listen loop and I'm trying to come up with a clean version that doesn't use found, and only accesses tib once or twice. 06:17:25 --- quit: virl (Remote closed the connection) 07:57:10 js4: any luck so far? 07:57:55 Oh yeah, I got it a while ago. But I want to sit on it a little bit see if I still like it in a day or so. 07:58:23 : (mysearch)( $a-$a || $a-$0 ) ( return dictionary header address, or 0 if not found ) 07:58:23 repeat over over d->name compare if dup which ! ;then @ zuntil ; 07:58:23 : mysearch ( $-$a|$0 ) last @ (mysearch) ; 07:58:23 : myword ( "-$ ) 32 accept tib ; 07:58:23 : my' ( "-a|0 ) myword mysearch nip z; d->xt @ ; 07:58:23 : mydict? ( $a-0|$ ) mysearch 0; nip dup d->xt @ swap d->class @ with-class 0 ; 07:58:25 : mynumber? ( $-n0|$ ) dup isNumber? 0; drop >number compiler @ if literal, then 0 ; 07:58:27 : myeval mydict? 0; mynumber? 0; myerror ; 07:58:29 : mylisten repeat myok myword myeval again ; 07:58:57 I don't really like "myeval" very much... 07:59:49 I was thinking about trying a strategy based on "sentinal" values. So the word will always be faoud, but sometimes it will be found as the last item in a fake dictionary header with a class of "convert to number"... 08:01:33 I like listen alot ^_^. Both retro and freeforth have the underlieing phylosophy "you look up a word and you do the same thing as always" 08:01:48 freeforth's "always" is compile, and retro's is "call the class" 08:02:38 that's why taking a sentinal approach would clean up the code. You always find the word, you always run the class. 08:23:52 interesting idea 08:26:56 I have considered writing parsing systems that do not invoke the dictionary, but it seems a little redundant. basically if you don't have a dictionary you end up with a long list of if statements like in the decompiler. 08:27:37 so a sentinal, that's a fake word that guards the end of the dictionary essentialy? 08:27:39 yeah, more than a few if/elseif/elseif/elseif... starts to get messy 08:27:51 Right, so say you are looking for X in a string. 08:27:56 there is a case macro in wheke 08:27:59 Replace the terminating 0 with X 08:28:06 You will only need 1 test in the loop 08:28:17 (really it's just a variable and a set of ifs) 08:28:20 You have the "did I really find it" test outside the loop 08:28:35 Loop runs faster, fewer bugs possible. 08:29:23 ahh 08:29:50 take some of the work out of the loop and puts it in a separate area 08:32:10 Right, makes most search loops have a single test instead of two tests. 08:33:06 in (mysearch) it may be slightly more readable with 2dup instead of over over 08:33:09 You do need to be able to modify the thing you are searching in though. But I don't think that's too hard to arrange. Anyway, the project is also for my own entertainment. I also used it to answer the question "can you write nice forth with out if/then. 08:33:42 My answer is, "not too rarely you *really* want an if/then." 08:34:08 I did get away with only 1 if in that code I think... maybe 3 if you count the if's in the class words. 08:34:35 of course, scratching your own personal itch is the main reason for any project in free software ;) 08:34:40 ^_^ 08:35:33 hmm. if could be shortened to e.g. parse a single word and compile it in, without a then. 08:50:10 Well my version is faster, but I'm not sure it's cleaner. 08:50:27 The sentinal version would probably be faster still. 08:55:10 Do you have any idea what a "superstring array" is? I am guessing it's an array of strings, but I never heard the trem before... 09:01:41 What we need are some good games in retro... tetris, minesweeper, solitair... other ideas? 09:02:08 pacman 09:03:11 I haven't heard it although it sounds like a physics reference :P 09:03:18 tetris would rock 09:03:44 there needs to be a time delay loop of some kind 09:03:54 yeah... can't do it without atleast curses though, and I don't have that on either of my versions... I 'spose I could try the windows version... 09:03:55 crc hasn't implemented it yet because it's a portability headache 09:04:13 it's possible in sdl 09:04:32 * docl once hacked the sdl version to have a time delay when 27 gets emitted 09:04:43 but I'm sure writing to a port is better 09:04:58 waiting for a key while waiting is what is really needed 09:05:06 polling, I believe it is called 09:10:50 hmm. seems like a time delay would be a natural extension of the wait opcode wouldn't it? 09:11:23 The ngaro feature I want to use/add is "reload image and restart" 09:11:36 Then it can act more like I see people using colorforth 09:11:59 doesn't "reset" do this? 09:12:16 I don't know. I want the feature, I haven't looked for it. 09:12:32 actually reset may just forget changes to the heap 09:12:53 nothing called reset in the vm.c source 09:13:27 and in the io port code I only see a call to vm_save_image() nothing like vm_load_image() 09:13:43 hmm, reset may just clear the screen 09:14:32 reset | .word | ...- | 09:14:32 --------------+--------------+------------+-------------- 09:14:32 Drop all items on the stack 09:14:46 ahh 09:14:51 that was it 09:15:33 I don't see anything in the ports section of retrolanguage.rst either. 09:15:40 hmm. something like : reboot [ last @ literal, ] last ! ; 09:16:38 : restart 0 push ; 09:16:49 will make the retro forth restart... 09:17:03 But won't reload the image 09:17:38 do you need to reload the image or just forget changes? 09:18:19 I would want to reload the image. Other features would be cool, but I am thinking of cases where my program goes wild and writes garbage all over the dictionary 09:18:32 ah yes 09:18:50 in that case some ngaro customization may be needed 09:19:34 Yes. But not clear how valuable it would be. After all, if retro is so broken that you need to reload the image, what are the odds enough of it is left to call ngaro to ask politely? 09:23:24 This is probably the change I like best to the listener... I make OK call .s 09:23:51 ( ) ok 1 09:23:51 ( 1 ) ok 2 09:23:51 ( 1 2 ) ok 3 09:23:51 ( 1 2 3 ) ok -rot 09:23:51 ( 3 1 2 ) ok 09:24:44 ( 3 1 2 ) ok 4 09:24:44 ( 3 1 2 4 ) ok 5 09:24:44 (5 ... 1 2 4 5 ) ok 6 09:24:44 (6 ... 2 4 5 6 ) ok 7 09:24:44 (7 ... 4 5 6 7 ) ok 09:25:33 nice 09:25:52 Hmmm think I'll change that to "( 4 3 2 1 OK ) " 09:26:06 then cut-n-paste the prompts will be comments 09:26:15 particularly good for newbie or debug mode 09:32:03 yeah, I like it. 09:32:25 not sure about "( 1 2 3 ok ) " as a prompt though... 09:33:36 And I enhanced see a little bit... 09:33:38 ( 23 ... 9 1 2 3 ok ) 4 09:33:38 ( 24 ... 1 2 3 4 ok ) .c 09:33:38 ( ok ) see .sok 09:33:38 9346 link: 9278 09:33:38 9347 class: .word 09:33:38 9348 xt: 9354 09:33:40 9349 name: .sok 09:33:42 9354 nop 09:33:44 9355 nop 09:33:46 9356 call 481 ( cr ) 09:33:48 9358 jump 9363 09:33:50 9360 Unknown: 40 '(' 09:33:52 9361 Unknown: 32 ' ' 09:33:54 09:33:56 ( ok ) 09:36:36 ( ok ) see 1+ 09:36:36 1467 link: 0 09:36:36 1468 class: .primitive 09:36:36 1469 xt: 20 09:36:36 1470 name: 1+ 09:36:37 20 nop 09:36:39 21 nop 09:36:41 22 1+ 09:36:43 23 ; 09:36:45 09:36:47 ( ok ) 09:38:18 breakfast time, bbiab... 09:39:52 ok 09:41:01 ooh, nice see enhancements 09:42:21 be sure to gist or commit 09:46:28 er commit/push ;) 09:55:30 : visible 32 accept tib keepString literal, 09:55:30 ` find ` if ` d->xt ` @ ` execute ` else ` drop ` then ; compile-only 09:55:30 : test visible foo ; 09:55:30 : foo words ; 10:00:48 --- join: luptenschteiner (n=User@unaffiliated/probonono) joined #retro 10:12:47 --- quit: probonono (Read error: 110 (Connection timed out)) 10:34:08 * docl is reading the muforth readme 10:36:18 his version of ] always compiles a literal. so [ 20 30 * ] instead of [ 20 30 * literal, ] or [ 20 30 * ] literal 10:37:00 to get into compiler mode without autocompiling the tos as a literal you would use -] instead 10:47:58 docl: in retro (at least the main source), I don't use ] literal at all 10:50:34 docl: in your vocab code (http://gist.github.com/271895), the word 'do' is not defined (referenced in .vocab) 11:16:16 --- join: erider (n=chatzill@unaffiliated/erider) joined #retro 11:16:37 hi 11:18:26 hi erider 11:18:28 cells are 32bit cubbyholes? range 0..4..8..12.. etc.. 11:18:42 cells are 32-bits 11:18:55 signed or unsigned 11:18:59 (except in the emacs implementation) 11:19:02 signed 11:19:24 can you change them to unsigned 11:19:40 if I modify the vm, then yes 11:20:05 ah ok so the internals would have to be modified 11:20:43 crc: yeah I took that out in my working code, will update the gist. the only use for it is if we want to make .vocab state smart so e.g. it requires a following open/close when in compile mode. not sure having such different behavior is really a good idea though. being specific about whether you are opening or shutting the vocab may or may not be important. 11:21:12 so if we has addressing 1000 1004 1008 1 = 1000 2 = 1004 3 = 1008 cells? 11:21:29 docl: expose the open/shut, and allow for ['] vocab open 11:21:42 docl: then you can use it implicitly or explicitly, at your discretion 11:22:03 erider: ngaro's addressing is purely cell based. 1000, 1001, 1002, etc 11:22:14 you don't deal with it at the byte level 11:22:16 hmm. toggle relies on open, and I'm not sure I want it exposed 11:22:57 just having it consistent in a definition and the interpreter will be enough 11:26:45 crc: so the distances between 1000 and 1001 cells is 32bits 11:26:53 yes 11:27:59 so how would you access a nibble or a byte at that cell location 1000 11:28:24 you would use the and/or/xor to mask off the parts you don't want 11:28:43 you can't directly address anything other than a cell 11:29:14 so you grab the whole cell 11:29:20 yes 11:30:05 cool thanks for all of the questions but I want to understand how it works 11:30:13 no problem 11:30:19 sorry* 11:31:29 ' returns xt right so what does ` return 11:31:48 ` is like 'postpone' in ANS forth 11:31:57 it compiles code to call a word via it's class handler 11:33:26 --- join: erider_ (n=chatzill@pool-173-69-160-231.bltmmd.fios.verizon.net) joined #retro 11:35:07 --- join: erider__ (n=chatzill@pool-173-69-160-231.bltmmd.fios.verizon.net) joined #retro 11:36:50 --- quit: erider__ (Client Quit) 11:42:43 --- join: erider__ (n=chatzill@pool-173-69-160-231.bltmmd.fios.verizon.net) joined #retro 11:44:47 [crcx/retro10] 5568eb: use new .vocab class and elements from docl 11:45:32 docl: I added code to compile a call to toggle when used in a definition 11:48:00 when building, you'll need to use the new 'prisitine' image, or load/save the new stage2 into an existing image since the metacompiler now depends on the existance of 'elements' 11:51:13 --- quit: erider (Read error: 110 (Connection timed out)) 11:51:45 [crcx/forthlets] f7488d: rem & chorder use new vocab code now 11:52:42 erider_: back to ` 11:52:55 : foo words ; 11:52:55 [crcx/wheke] 718736: forth94 now uses new vocab code 11:52:57 --- quit: erider_ (Read error: 110 (Connection timed out)) 11:53:09 erider__: would compile a call to 'words' and a return instruction 11:53:16 : foo ` words ; 11:53:23 --- nick: erider__ -> erider_ 11:53:31 --- nick: erider_ -> erider 11:53:41 would compile a pointer to 'words', a call to the class handler (.word) or 'words', and the return instruction 11:54:21 return to the stack 11:55:39 return to the calling function 11:57:50 ok 11:59:08 crc: nice! 12:00:22 what other word returns a xt 12:01:14 erider: ['] ' find 12:02:20 so one 12:02:24 that is good to know 12:14:31 http://gist.github.com/273738 12:16:11 the stuff above ---reveal--- is private right? and stuff underneath is public 12:16:17 yes 12:16:43 ok 12:18:28 docl: these are for adding words to a vocabulary? 12:18:35 docl: couldn't you refactor nod to be : nod ( -a ) last @ ; 12:21:02 http://gist.github.com/271895 12:21:07 crc: yes 12:21:13 or rather changing their position 12:21:31 : nod ( -a ) last @ @ ; 12:21:38 "next on dict" 12:22:32 could be lid/nid I suppose -- last in dict, next in dict 12:25:44 that might be better as "on" refers more to a stack whereas "in" might refer more clearly to linked lists. 12:28:47 crc: sorry I didn't quite parse the question correctly. they move the position of a word to the end of the stack, so the vocab word is what is moved. this does have the effect of putting the following words inside the vocab. I suppose we could use a similar approach to put later words in a vocab by moving them to immediately before the vocab word in the dictionary while it is open. 12:29:54 they are *also* useful for moving factors from the private area to the public area, which is what I did with open/shut 12:30:48 [crcx/retro10] ca3241: add expose and >last and d' 12:34:17 create takes addr off the stack right? 12:34:33 create doesn't take anything off the stack 12:34:39 it parses for a name 12:35:05 and create a header pointing with an xt pointed to the next free memory location ('here') 12:35:07 but what if you have create ['] 12:35:25 create ['] 12:35:38 yeah 12:35:41 would create a dictionary header with a name of ['] and a class of .data 12:35:51 (assuming you're at the interpreter) 12:36:08 create ['] foo reclass 12:36:19 in a definition? 12:36:25 yes 12:36:56 8653 call 678 ( create ) 12:36:57 8655 lit 424 ( .word ) 12:36:57 8657 call 4158 ( reclass ) 12:37:15 call to create, address of .word (or whatever), call to reclass 12:37:25 ['] is a macro that gets an xt and compiles it as a literal 12:37:55 when the word is called, it'll call create to make a new header, then use reclass to change the class to whatever's specified on the stack 12:38:17 so I guess I am asking what word is consuming the xt on the stack reclass? 12:38:32 reclass consumes the xt left by ['] 12:38:57 trying to parse words one by one 12:41:10 last is just a variable that holds the last entry point in the dictionary 12:41:23 yes 12:43:34 create parses to space 12:43:41 yes 12:44:21 ' parses to space too 12:45:03 yes 12:45:34 : reclass: ( a"- ) ' reclass ; immediate might be more intuitive as you can just put the class name right after it. 12:45:35 so if create is consuming ['] how can ['] consume foo 12:45:56 create isn't a macro 12:46:11 : mycreate create last @ reclass: .myclass ; 12:46:12 it's only called at runtime 12:46:19 not at compile time 12:46:29 so it doesn't consume ['] right away 12:46:36 it never sees ['] 12:46:52 : foo create ['] bar reclass ; 12:46:55 : is called 12:47:00 ahhhhhhhhhhhhhhhhh macro 12:47:04 it parses for a name, and creates it with a class of .word 12:47:13 create is encountered 12:47:15 so ['] it is replaced 12:47:22 since the compiler is on, a call to create is compiled 12:47:27 ['] is encountered 12:47:48 it's a macro, so it parses for a name, and compiles the xt of that word as a literal 12:48:10 reclass is encounterd, and it's a normal word, so a call to it is compiled 12:48:26 ; is encountered. it's another macro, so it compiles are return and turns off the compiler 12:48:41 now, when 'foo' is run: 12:48:49 foo myword 12:48:54 foo gets called 12:49:02 but if it was from the interpreter create would consume 12:49:06 ['] 12:49:11 it calls create, which parses for a string ("myword") 12:49:23 the address compiled by ['] is pushed to the stack 12:49:26 reclass is called 12:49:32 and the word returns to the interpreter 12:49:34 erider: yes 12:49:45 ok I getting it 12:49:51 i'm 13:45:08 any more questions? 13:45:27 I am looking at some samples 13:46:36 compile mode is like inline in reva? 13:47:44 ? 13:48:12 nevermind I get it 13:52:23 crc: how do the loops work 13:52:32 you have for and repeat 13:53:09 three types of loops 13:53:15 repeat ( whatever ) again is a forever loop? 13:53:16 repeat/again - unconditional loops 13:53:23 for/next - counted loops 13:53:33 fori/nexti - counted loops, which put the index on the stack 13:54:23 for/next count down, fori/nexti counts up 13:54:30 : foo 10 for r . next ; 13:54:39 : bar 10 fori . nexti ; 13:54:41 foo 13:54:42 bar 13:54:46 to see the difference 14:29:31 --- topic: set to 'Retro Forth | Logs @ http://tr.im/K0ap | http://retroforth.org | Stable Release 10.3.1 - January 2010' by crc 14:30:34 I am happy 14:31:01 why? 14:31:49 I am getting it 14:48:48 I think understanding how the retro works will help me understand some of the samples 14:57:59 erider: congrats :) 14:58:06 lol 14:58:24 it's a cool feeling when you finally grasp something like this 15:04:00 yeah :) 15:06:27 sigh... I don't get why git hates me so much... 15:19:01 I haven't made any changes to retro10, but github complains 3 outstanding edits (2 from crc and 1 from docl ) can't be applied. 15:21:27 I wish it would show me what the conflicts are... I am coming to hate git/github... 15:29:33 --- join: virl (n=virl__@chello062178085149.1.12.vie.surfer.at) joined #retro 15:37:25 Drat, I just accidentally deleted a mail from some guy in africa who's got 600,000 USD for me. Sure coulda used that money... lol 15:54:58 so I can find "not" which flips individual bits. I am looking for a word like 0= though. : word 0 =if -1 else 0 then ; 16:07:22 git diff master^1 should show you the most recent edits 16:08:11 hmm, there is on/off 16:08:48 variable foo foo on ( set foo to -1 ) foo off ( set foo to 0 ) 16:09:12 remember a few days ago when I beat on git till I thought it had my fork identical to crc's? I haven't changed anything since then. 16:09:14 --- quit: virl (Remote closed the connection) 16:10:49 Most of the recent changes from y'all applied. Three didn't. 16:11:30 * docl doesn't use the cherry-picking feature... doesn't work well enough 16:11:39 I really hate trying to manipulate my fork by pushing buttons on a web site. All I know is "some boxes are red" and no clue why. 16:12:33 : almost0= dup negate xor not ; 16:13:20 0x8000...000 *and* 0x000...000 both return -1 for that code. 16:16:28 ooops, 'cept negate isn't spelled that way... or defined? 16:25:44 yeah stick with git pull master and you'll be fine. 16:26:19 (once you get it working again) 16:27:03 somehow I think I am missing something about git, something about the way I use it is making it un happy. 16:28:37 Or maybe it's cause I submitted a change crc never applied... I don't know how to undo that though. I actually *deleted* my fork and reforked, did every kind of "make mine like crc's" I can think of. It's not good enough. 16:30:43 And if there is no clean way to deal with "I made a change, he didn't like it, we both go on" then git is junk. And I just can't believe so many smart people are using junk. *I* must not understand something about git. 16:40:01 ooops, my almost0= is nogood. /me thinks some more... 17:10:25 everyone still around 17:10:48 I am 17:11:28 cool 17:11:36 what you up to 17:12:48 grumbling about how painful git/github is to use, trying to figure a no-if way to do 0= 17:14:50 really 17:15:16 best I have is the pointless : 0= dup 1 << or dup 1 >> or dup 2 << or dup 2 >> or dup 4 << or dup 4 >> or dup 8 << or dup 8 >> or dup 16 << or dup 16 >> or not ; 17:16:34 what is the stack diagram 17:16:52 : 0= 0 =if -1 else 0 then ; 17:18:24 is that the regular implementation 17:18:40 sure, can you do it with no if's though? 17:18:58 just a puzzle, not important 17:19:48 prolly would need to use xor or and to accomplish the task 17:20:30 The hardware implementation is an or tree of the bits and a not gate 17:22:38 gotta be some trick like " dup neg and " selects the left most 1 bit. 17:24:12 hmm 17:24:31 ohhh what about "dup neg and not dup 1 >> or not" 17:25:32 "dup neg and" has either 1 bit on, or none. 17:25:52 "... not" has all bits on or none... 17:25:55 ooops 17:26:14 back 17:26:19 wb 17:27:27 I heard a rumor that the NSA always asks for the computer instruction "count the number of 1 bits in a cell/word/register" 17:27:31 you should need to shift 17:28:07 ?? 17:28:14 NSA what? 17:28:30 weird instruction, huh? NSA is a big spy agency in the USA 17:29:14 what about the instruction stuff 17:29:20 I don't follow 17:29:24 about the rumor 17:29:29 anyway, thier instruction is a sum of all the bits in a word. 0= is an or of all the bits followed by a not. 17:29:48 "parity" is the xor of all the bits 17:29:56 ok we know that xoring a number with zero returns the number 17:30:10 "-1=" and of all the bits 17:30:40 anding a number with zero returns 0 17:31:19 0!= is just an or of all the bits... "count" is sum, "0!=" is or, "parity" is xor, "-1=" is and.... that's why I thought of it... 17:33:18 "dup neg or".... 17:38:40 so you where checking how the bits for zero 17:39:41 you can make a mask 17:39:44 This is twice as fast as my last one... 17:39:45 : 0= dup neg or dup 1 >> or dup 2 >> or dup 4 >> or dup 8 >> or dup 16 >> or ; 17:40:00 ooops,... needs a not at the end 17:43:59 oh... duh 17:44:15 : 0= dup neg or 32 >> not ; 17:45:40 : =0 dup 255 and 0 = ; 17:45:53 : 0= dup 255 and 0 = ; 17:47:36 yes, but look at the definition of = 17:48:01 : 0= 0 = ; 17:48:24 : = =if -1 else 0 then ; 17:48:35 no if's allowed. 17:50:14 grrr... bug (?) in console retro. 32 >> isn't the sign bit. 17:50:26 but 31 is 17:50:46 bit 0, 1, 2, 3, .... 31 17:50:49 its signed 17:51:06 : 0= dup 255 and 0 = ; 17:51:09 do "-4 32 >> ." I expect to see -1 17:51:32 = has an if in it 17:51:50 = has a if? 17:51:54 ah ok 17:51:55 yes 17:52:40 we need to mask them 17:53:46 js4: the behavior of >> is consistent with other forths I've used 17:54:31 Really? Try "-4 31 >> ." then "-4 32 >> ." then "-4 33 >> ." 17:54:37 I expect -1 -1 -1 17:56:48 in reva: 17:56:52 ok> -4 31 >> . 17:56:52 1 17:56:53 ok> -4 32 >> . 17:56:53 -4 17:56:53 ok> -4 33 >> . 17:56:53 2147483646 17:56:54 ok> 17:57:25 same in gforth 17:57:39 retro differs slightly, but 31 is still the sign bit 17:58:11 ok : t 32 for cr ." -4 >> " 20 r + dup . -4 swap >> ." is " . next ; 17:58:11 ok t 17:58:11 -4 >> 52 is -1 17:58:11 -4 >> 51 is -1 17:58:11 -4 >> 50 is -1 17:58:12 -4 >> 49 is -1 17:58:14 -4 >> 48 is -1 17:58:16 -4 >> 47 is -1 17:58:18 -4 >> 46 is -1 17:58:20 -4 >> 45 is -1 17:58:22 -4 >> 44 is -1 17:58:24 -4 >> 43 is -1 17:58:26 -4 >> 42 is -1 17:58:28 -4 >> 41 is -1 17:58:30 -4 >> 40 is -1 17:58:32 -4 >> 39 is -1 17:58:34 -4 >> 38 is -1 17:58:36 -4 >> 37 is -1 17:58:38 -4 >> 36 is -1 17:58:40 -4 >> 35 is -1 17:58:42 -4 >> 34 is -1 17:58:44 -4 >> 33 is -2 17:58:46 -4 >> 32 is -4 17:58:48 -4 >> 31 is -1 17:58:50 -4 >> 30 is -1 17:58:52 -4 >> 29 is -1 17:58:54 -4 >> 28 is -1 17:58:56 -4 >> 27 is -1 17:58:58 -4 >> 26 is -1 17:59:00 -4 >> 25 is -1 17:59:02 -4 >> 24 is -1 17:59:04 -4 >> 23 is -1 17:59:06 -4 >> 22 is -1 17:59:08 -4 >> 21 is -1 17:59:10 ok 17:59:12 weird... someting in the CPU I bet. 17:59:52 yes 31 moves the sign bit to the 1's bit on a 32 bit machine. But I assumed any number greater than 31 would work as well. The CPU's seem to dissagree with me. 18:01:33 I guess you can shift and check every bit location 18:03:01 -4 >> 193 is -2 18:03:01 -4 >> 192 is -4 18:03:01 -4 >> 161 is -2 18:03:01 -4 >> 160 is -4 18:03:01 -4 >> 129 is -2 18:03:02 -4 >> 128 is -4 18:03:04 -4 >> 97 is -2 18:03:06 -4 >> 96 is -4 18:03:08 -4 >> 65 is -2 18:03:10 -4 >> 64 is -4 18:03:12 -4 >> 33 is -2 18:03:14 -4 >> 32 is -4 18:03:16 weird 18:03:29 the pattern continues up to 1000 18:03:58 looks like the cpu is doing a mod32 in the >> 18:04:40 so 32 >> is 0 >>, 33 >> is 1 >>, etc. 18:06:18 I have no idea what reva is doing 18:07:19 in retro, the behavior matches that of >> in C 18:08:31 It's likely to be cpu/language dependant if you >> more than bits-1 sigh. 18:09:24 Well, the best answer I've gotten so far to my pointless puzzle is 18:09:25 : 0= dup neg or 31 >> ; 18:09:36 but the 31 is cpu/language dependant v.v 18:10:55 The elisp version on my computer does what I expect. 18:11:13 -4 >> x = -1 if x >= 2 18:31:04 --- quit: erider (Read error: 113 (No route to host)) 19:07:10 --- quit: SimonRC (farmer.freenode.net irc.freenode.net) 19:08:37 --- join: SimonRC (n=sc@fof.durge.org) joined #retro 22:36:51 --- join: Raystm2 (i=rastm2@c-24-8-232-212.hsd1.co.comcast.net) joined #retro 22:42:06 --- quit: Raystm2 ("User pushed the X - because it's Xtra, baby") 23:59:59 --- log: ended retro/10.01.10