axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Re: coerce to SEX


From: Mike Dewar
Subject: Re: [Axiom-developer] Re: coerce to SEX
Date: Mon, 5 Jul 2004 10:12:52 +0100
User-agent: Mutt/1.4.1i

The "_" is the escape character in the interpreter.  In Lisp you can
call a function by prefixing it with the name of the package in which it
is defined, so in this case (boot::genvar) should call the genvar
function defined in the boot package (actually (boot:genvar) probably
works because genvar is almost certainly defined as an external symbol).

Unfortunately ":" and "::" have special meanings in the interpreter so
cannot be used to prefix a lisp function with its package name.  I
suspect that BOOT_:_:GENVAR()$Lisp is interpreted as a call to the
symbol |BOOT::GENVAR|, hence the error message.

If you are desperate you can go:
  APPLY(FIND_-SYMBOL('GENVAR,'BOOT)$Lisp,[]$Lisp)$Lisp
which looks up the genvar symbol in the boot package and then applies
it.  Of course in this particular case you can call genvar directly since
boot is in fact the current package.

Cheers, Mike.

On Fri, Jul 02, 2004 at 07:00:27PM -0400, William Sit wrote:
> Thanks, Mike. The BOOT_:_:GENVAR()$Lisp does not work on my version either. 
> But
> I noticed the underlines get deleted. Does the underline need any escape
> character preceding it? What does this command do?
> 
> William
> 
> Mike Dewar wrote:
> > 
> > You can use any Lisp function in the current Lisp package from the Axiom
> > interpreter using `$Lisp', but you need to bear in mind some slight
> > syntactic differences.  For instance your example can be done as:
> > a:=any(['Integer]$Lisp,3::None) -- use [ ... ] as shorthand for list(...)
> > a:=any(LIST('Integer)$Lisp,3::None) -- apply LIST from Lisp
> > Note that although the lisp interpreter will upper-case everything,
> > Axiom doesn't so e.g. list(1)$Lisp won't work.
> > 
> > I thought that you could package-qualify lisp calls in the interpreter
> > by doing e.g. BOOT_:_:GENVAR()$Lisp, but this doesn't work in my version.
> > 
> > I hope this helps.
> > 
> > Mike.
> > 
> >
> > > Is there any documentation for all the Lisp code that can be used in 
> > > Axiom?
> > > (Lisp is NOT a domain despite the $Lisp notation). Are the commands part 
> > > of the
> > > Boot language? (this may be a very stupid question).
> > >
> > > William
> 
> 
> _______________________________________________
> Axiom-developer mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/axiom-developer
> 
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ________________________________________________________________________

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________




reply via email to

[Prev in Thread] Current Thread [Next in Thread]