An integer (fn …) form, the kind compile-asm compiles, as the pure-x function it means: the twin a compiled loop is checked against.
int-form-pureThe integer function FORM means, as pure x: its operators bound to the int doors, so it runs where compile-asm cannot and answers what compile-asm’s answers.
Parameters:
LIST — A (fn (self …) …) form over integers: + - * < = » « &, (*» a b k) for a product shifted down k places through 64 bits, if, match, do, and the %mem- byte and word loads and storesReturns: CALLABLE — The function
Examples:
(do (import x/tool/int-form int-form-pure) ((int-form-pure (lit (fn (self n acc) (if (< n 1) acc (self (- n 1) (+ acc n)))))) 4 0)) => 10int-form-wideFORM with each (» a b k) written as (» ( a b) k): the form compile-asm takes on an 8-byte word, where one word holds the product.
Parameters:
LIST — An int formReturns: LIST — The form, its *» products spelled as a multiply and a shift
Examples:
(do (import x/tool/int-form int-form-wide) (equal? (int-form-wide (lit (fn (_ a b) (*>> a b 16)))) (lit (fn (_ a b) (>> (* a b) 16))))) => #t