login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Boot (more precisely newer dialect called Shoe) is used internally in FriCAS for some of the interpreter and compiler code. Here is a detailed description of the Boot Language

This is a simple example of Boot programming.

Define a function.

boot
pairBoot(a,b) ==
  a>b => [-b,-a]
  [a,b]
boot
9211484592716052519-25px001.clisp PRODUCED
; compiling file "/var/aw/var/LatexWiki/9211484592716052519-25px001.clisp" (written 20 APR 2018 03:59:52 PM):
; /var/aw/var/LatexWiki/9211484592716052519-25px001.fasl written ; compilation finished in 0:00:00.003

Now call it.

fricas
pairBoot(1,4)$Lisp

\label{eq1}\left(1 \  4 \right)(1)
Type: SExpression?
fricas
map(integer,destruct(pairBoot(3,2)$Lisp))

\label{eq2}\left[ - 2, \: - 3 \right](2)
Type: List(Integer)

That's my first Boot function!

You can now write for example:

boot
foobar(x,y) == x + y
boot
7491012761112044243-25px003.clisp PRODUCED
; compiling file "/var/aw/var/LatexWiki/7491012761112044243-25px003.clisp" (written 20 APR 2018 03:59:52 PM):
; /var/aw/var/LatexWiki/7491012761112044243-25px003.fasl written ; compilation finished in 0:00:00.001

And call it with

fricas
integer(foobar(2,3)$Lisp)

\label{eq3}5(3)
Type: PositiveInteger?

In FriCAS (from revision 1049 on) the simplest way to compile and load boot code is to write it into a file and then call something like:

  )read FILE.boot




  Subject:   Be Bold !!
  ( 14 subscribers )  
Please rate this page: