DELETED user/crc/fixed-point/fixed-point.retro Index: user/crc/fixed-point/fixed-point.retro =================================================================== --- user/crc/fixed-point/fixed-point.retro +++ user/crc/fixed-point/fixed-point.retro @@ -1,49 +0,0 @@ -( Fixed Point Numbers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ) -( This is an implementation of fixed point math for Retro. ) -( Basically it gives us a way to handle numbers with decimals ) -( in a sane manner. It's also more accurate than floating ) -( point. ) -( ) -( We represent a fixed point number by two values on the data ) -( stack. One is the actual value, the other is the position ) -( of the decimal point. The words operating on fixed point ) -( values check to make sure the decimal places are the same. ) -( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ) -( __f Add 'f' prefix for fixed point numbers ) -( \f.+ Add two fixed point numbers ) -( \f.- Subtract two fixed point numbers ) -( \f.* Multiply two fixed point numbers ) -( \f./ Divide two fixed point numbers ) -( \f.mod Get remainder of two fixed point nums ) -( \f.display Display two fixed point numbers ) -( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ) - -chain: f -{{ - : x:c ( d-aa ) dup @d->xt swap @d->class ; - : prior ( "- ) - @last push @last @ !last - 32 accept tib find if x:c with-class else notfound then - pop !last ; immediate - : scale ( n-n ) 1 swap for 10 * next ; - : zpad ( n- ) - dup scale swap 1- for 10 / 2dup number ; ----reveal--- - : __f ( $-nn ) - here swap place - @compiler if .data .data ;then swap ; parsing - : display ( nn- ) - tuck scale /mod (.) '. emit swap zpad (.) ; - : + ( nnnn-nn ) push nip prior + pop .data ; - : - ( nnnn-nn ) push nip prior - pop .data ; - : * ( nnnn-nn ) push nip prior * pop .data ; - : / ( nnnn-nn ) push nip prior / pop .data ; - : mod ( nnnn-nn ) push nip prior mod pop .data ; -}} -;chain DELETED user/crc/fixed-point/test.fixed-point.retro Index: user/crc/fixed-point/test.fixed-point.retro =================================================================== --- user/crc/fixed-point/test.fixed-point.retro +++ user/crc/fixed-point/test.fixed-point.retro @@ -1,15 +0,0 @@ -include fixed-point.retro - -with f - -( some tests ) -f10.21 display -f1002.313 display -f10.09 display - -f100.21 -f231.31 -+ -display - -f10.009 display DELETED user/crc/quotes.rx Index: user/crc/quotes.rx =================================================================== --- user/crc/quotes.rx +++ user/crc/quotes.rx @@ -1,17 +0,0 @@ -( Quotes: Anonymous, nestable blocks of code ~~~~~~~~~~~~~~~~ ) -( Copyright [c] 2010, Charles Childers ) -( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ) - -{{ - variable here - : done? ( qn- ) dup 0 =if pop drop 2drop ;then ; ----reveal--- - : mark ( - ) @heap !here ; - : free ( - ) @here !heap ; - : [[ ( -na ) @compiler ahead ] ; immediate - : ]] ( na-q ) dup ` ;then 1+ swap !compiler .data ; immediate - : i ( -n ) pop pop pop pop dup @heap ! push push push push @heap @ ; - : I ( -n ) pop i swap push not -1 * ; - : times ( nq- ) repeat swap done? 1- push dup push execute pop pop swap again ; - : ifte ( fqq- ) rot if drop else nip then execute ; -}}