2023-12-28 04:34:48 vms14, i see, interesting example 2023-12-28 14:47:55 well this is hell 2023-12-28 14:48:33 my equality primitives all have the stack effect ( a b -- a b f ) and i've decided to change them to ( a b -- f ) ... loooots of code to wade through and fix now 2023-12-28 18:15:47 f me... over three hours gone, but i think i'm done 2023-12-28 18:16:25 let's not do that again 2023-12-28 18:16:43 Narrator: they do it again 2023-12-28 18:17:43 i recall one time i had the bright idea to make = look like : = ( x1 x2 -- x1 x2 0 | x1 -1 ) and similar for the other comparison operators. thinking was that if they're equal, why do you need two on the stack?? 2023-12-28 18:17:50 turns out that was confusing as hell 2023-12-28 18:55:27 zelgomer: what use are these kind of operators? 2023-12-28 19:06:02 are you asking what use is = ? 2023-12-28 19:33:07 oh i think KipIngram has some operators like that .. they do the comparison but they don't pop the original values from the stack 2023-12-28 19:33:16 i forget how he names them 2023-12-28 19:34:11 they would be like : .= ( x0 x1 -- x0 x1 flag ) 2dup = ; 2023-12-28 19:34:40 i *think* he puts a . before the = to mean it doesn't pop the arguments .. cant remember for sure 2023-12-28 19:51:32 no, what use is that spefic implementation you gave 2023-12-28 19:53:43 you'll have to be more specific. they all compare the values of the top two cells 2023-12-28 20:06:25 leaving one of the values on stack instead of just the boolean result 2023-12-28 20:08:56 i find that most of the time i'm comparing something, it's preceeded with either dup or 2dup 2023-12-28 20:11:09 i thought it would be more convenient to just nondestructively compare and push a flag. but then i found a lot of situations where i wind up doing = nip nip 2023-12-28 20:12:41 most loops definitely benefit from the nondesteuctive forms though. they end up like begin < while instead of begin 2dup < while 2023-12-28 20:21:15 hmm... how do you handle combinetory conditions then? 2023-12-28 20:21:26 letsay like within 2023-12-28 20:37:40 : within rot < nip if 2drop 0 exit then < nip nip ; or something like that, i guess 2023-12-28 20:38:58 well, i got the order of inputs backwards, but you get the idea 2023-12-28 20:39:51 I see 2023-12-28 20:40:15 and you can also see why i decided this was a bad idea and took three hours to change it 2023-12-28 20:42:19 : within ( val min max ) >R OVER < SWAP R> < AND ; \ iirc 2023-12-28 20:43:57 with the usual < that takes two signed numbers and leaves a bool 2023-12-28 20:47:53 i'll be honest, i'm not very good at forth :) 2023-12-28 20:48:25 talking about < I found it nifty how one can implement it without having a < instruction at all when I was doing fcpu-16 (only sixteen base instructions and quite optional extended set) 2023-12-28 20:49:01 well, forth makes you think about your programming problem differently 2023-12-28 20:49:46 hex : < swap - 8000 test ; 2023-12-28 20:50:34 hmm that doesn't handle negatives well 2023-12-28 20:51:42 pretty much but I started with 0< which basically is the 0x8000 test part 2023-12-28 20:52:01 oh right 2023-12-28 20:53:32 I do not recall how I handled the negatives but it was rather straight forward 2023-12-28 21:32:16 i think < should really be a primitive ... you can sort of do : < - 0< ; but it doesn't handle overflow 2023-12-28 21:33:00 i think all cpu's have a < instruction, or at the least a - with a branch that jumps on less-than