x-lang

← Index

x/tool/int-form

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-pure

The 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:

Returns: 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)) => 10

int-form-wide

FORM 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:

Returns: 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