[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Axiom-mail] What is gazonk*.c
From: |
Bill Page |
Subject: |
RE: [Axiom-mail] What is gazonk*.c |
Date: |
Mon, 23 Oct 2006 12:00:28 -0400 |
The gazonk*.c file is a temporary file created by the Lisp
(gcl) compiler. gcl compiles Lisp to "C" and then calls gcc
to create the object file.
On October 23, 2006 11:24 AM ming lu wrote:
>
> I just started to learn axiom and is running it under linux.
Hello! Welcome to Axiom. :-)
> I got following error when I tried to build a Fibonacci number.
> Anyone could show me what I did wrong?
You are not doing anything wrong. I also get an error when I
try your definition, although it is a different error:
Compiling function p as a recurrence relation.
(4) -> p(3)
>> System error:
The function |*1;p;1;initial| is undefined.
--------
I am using an experimental version of Axiom compiled from the
build improvements branch on August 30, 2006.
The way you wrote the defintion should work but you have found
a bug in Axiom. Thank you for your report.
BTW, what version of Axiom are you using? What version of C
compiler is installed on your system?
Try it this way:
(1) -> p:NNI->NNI
Type: Void
(2) -> p(0)==1
Type: Void
(3) -> p(1)==1
Type: Void
(4) -> p(n:NNI):NNI == p(n-1)+p(n-2)
Function declaration p : NonNegativeInteger -> NonNegativeInteger
has been added to workspace.
Type: Void
(5) -> p(3)
There are no library operations named p
Use HyperDoc Browse or issue
)what op p
to learn if there is any operation containing " p " in its name.
Cannot find a definition or applicable library operation named p
with argument type(s)
Integer
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
AXIOM will attempt to step through and interpret the code.
Compiling function p with type NonNegativeInteger ->
NonNegativeInteger
(5) 3
Type:
PositiveInteger
> Thanks,
> Ming
> (1) -> p(0)==1
>
> Type: Void
> (2) -> p(1)==1
>
> Type: Void
> (3) -> p(n)==p(n-1)+p(n-2)
>
> Type: Void
> (4) -> p(3)
> Loading /home/mlu/axiom/mnt/linux/algebra/INT.o for domain Integer
> Loading /home/mlu/axiom/mnt/linux/algebra/PI.o for domain
> PositiveInteger
> Loading /home/mlu/axiom/mnt/linux/algebra/NNI.o for domain
> NonNegativeInteger
> Compiling function p with type Integer -> PositiveInteger
> Loading /home/mlu/axiom/mnt/linux/algebra/BOOLEAN.o for domain
> Boolean
> Compiling function p as a recurrence relation.
Notice that Axiom is trying to do something special here. It
recognizes this as a recurrence relation. The way I wrote the
definition above avoids this "special treatment".
> /tmp/gazonk2.c:414: redeclaration of C++ built-in type `bool'
> /tmp/gazonk2.c:2834: syntax error before `new'
> In file included from /tmp/gazonk2.c:3185:
> /tmp/gazonk2.c:1976: previous declaration of `void*
> malloc(unsigned int)' with
> C++ linkage
> /usr/include/stdlib.h:584: conflicts with new declaration
> with C linkage
> /usr/include/stdlib.h:584: declaration of `void*
> malloc(unsigned int) throw ()'
> throws different exceptions
> /tmp/gazonk2.c:1976: than previous declaration `void*
> malloc(unsigned int)'
> /tmp/gazonk2.c:1977: previous declaration of `void*
> realloc(void*, unsigned
> int)' with C++ linkage
> /usr/include/stdlib.h:595: conflicts with new declaration
> with C linkage
> /usr/include/stdlib.h:595: declaration of `void*
> realloc(void*, unsigned int)
> throw ()' throws different exceptions
> /tmp/gazonk2.c:1977: than previous declaration `void*
> realloc(void*, unsigned
> int)'
> /tmp/gazonk2.c:3389: syntax error before `new'
> /tmp/gazonk2.c:3835: syntax error before `new'
> /tmp/gazonk2.c:3836: syntax error before `new'
> /tmp/gazonk2.c:3837: syntax error before `new'
> /tmp/gazonk2.c:3954: syntax error before `export'
> /tmp/gazonk2.c: In function `void L1()':
> /tmp/gazonk2.c:2450: too many arguments to function `lispunion* elt()'
> /tmp/gazonk2.c:5159: at this point in file
> /tmp/gazonk2.c:2450: too many arguments to function `lispunion* elt()'
> /tmp/gazonk2.c:5160: at this point in file
> /tmp/gazonk2.c:2450: too many arguments to function `lispunion* elt()'
> /tmp/gazonk2.c:5161: at this point in file
> /tmp/gazonk2.c:5180: too many arguments to function
> (4) ->
>
I do not understand why you are getting syntax errors in the
generated "C". This does not happen on my system - although
there is another problem which prevents the definition of p
from working.
This looks like you might be using a version of gcc that is
not compatible with the version of gcl Lisp on which the
version of Axiom that you are using is based.
Regards,
Bill Page.