/usr/share/axiom-20170501/src/algebra/MKBCFUNC.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | )abbrev package MKBCFUNC MakeBinaryCompiledFunction
++ Author: Manuel Bronstein
++ Date Created: 1 Dec 1988
++ Date Last Updated: 5 Mar 1990
++ Description:
++ Tools and transforms for making compiled functions from
++ top-level expressions
MakeBinaryCompiledFunction(S, D1, D2, I) : SIG == CODE where
S : ConvertibleTo InputForm
D1: Type
D2 : Type
I : Type
SY ==> Symbol
DI ==> devaluate((D1, D2) -> I)$Lisp
SIG ==> with
binaryFunction : SY -> ((D1, D2) -> I)
++ binaryFunction(s) is a local function
compiledFunction : (S, SY, SY) -> ((D1, D2) -> I)
++ compiledFunction(expr,x,y) returns a function \spad{f: (D1, D2) -> I}
++ defined by \spad{f(x, y) == expr}.
++ Function f is compiled and directly
++ applicable to objects of type \spad{(D1, D2)}
++
++X MBCF:=MakeBinaryCompiledFunction(POLY(FRAC(INT)),FLOAT,FLOAT,FLOAT)
++X f:=(x+3)*(y+4)
++X g:=compiledFunction(f,x,y)$MBCF
++X g(2.0,3.0)
CODE ==> add
import MakeFunction(S)
func: (SY, D1, D2) -> I
func(name, x, y) == FUNCALL(name, x, y, NIL$Lisp)$Lisp
binaryFunction name == (d1:D1,d2:D2):I +-> func(name, d1, d2)
compiledFunction(e, x, y) ==
t := [devaluate(D1)$Lisp, devaluate(D2)$Lisp]$List(InputForm)
binaryFunction compile(function(e, declare DI, x, y), t)
|