axiom-mail
[Top][All Lists]
Advanced

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

Re: [Axiom-mail] Help with AXIOM


From: David MENTRE
Subject: Re: [Axiom-mail] Help with AXIOM
Date: Fri, 09 Jan 2004 23:49:24 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (gnu/linux)

Hello Elias,

I would prefer that you publicly ask on axiom-mail mailing list, it
would probably help other people.

"Elias P. TSIGARIDAS" <address@hidden> writes:

> I have the code that i append you at the end of the email
>
> i compile the code
>
> )compile timer.spad
>
>
> but the i can not understand how to call the functions....
>
>
> i have a function say foo()
> How  can i time it with runFunction() ??

(1) -> )compile timer.spad
[...]
(1) -> foo () == 1 + 2
                                                                   Type: Void
(2) -> runFunction(foo, 3)
   Compiling function foo with type () -> PositiveInteger 
 
   >> System error:
   GCTIME is invalid as a function.

protected-symbol-warn called with (NIL)


However, it appears that your package call a lisp fonction GCTIME that
does not exists, at least in GCL. Sorry, I can't help on that. I have
googled but found nothing. 

I include gcl-devel in copy, maybe somebody there can be of some help
for your issue.

Why don't you use standard Axiom functions for timing? Need to store the
result?

Yours,
d.

> --- code for timer.spad
>
>
>
> )ab package TIMER NewTimingFunctions
>
> NewTimingFunctions : PUB == PRIV where
>
>   PUB == with
>     totalTime : () -> Integer
>       ++ Total counting time in milliseconds
>     gcTime : () -> Integer
>       ++ Gc counting time in milliseconds
>     evaluationTime : () -> Integer
>       ++ Evaluation counting time in milliseconds
>
>   PRIV == add
>
>     totalTime () ==
>       evaluationTime() + gcTime()
>
>     evaluationTime () ==
>       (GET_-INTERNAL_-RUN_-TIME()$Lisp) pretend Integer
>
>     gcTime () ==
>        (GCTIME()$Lisp) pretend Integer
>
>
> )ab package RUNF RunFunction
>
> RunFunction(Dom:SetCategory) : PUB == PRIV where
>
>   PUB == with
>
>    runFunction : ((()->Dom),Dom) -> Integer
>    doRun : ((()->Dom),Dom,String) -> Void
>    mapRun : (List(()->Dom),Dom,String) -> Void
>
>   PRIV == add
>
>     mapRun(lf,res,mes) ==
>       for f in lf repeat
>         t := totalTime()$NewTimingFunctions
>         runRes := f()
>         (runRes = res) =>
>           s : String := convert(totalTime()$NewTimingFunctions -t)$Integer
>           messagePrint(concat([mes, " in ", s ]))$OutputForm
>         messagePrint(concat(mes, " Bad result"))$OutputForm
>
>     doRun(f,res,mes) ==
>       t := totalTime()$NewTimingFunctions
>       runRes := f()
>       (runRes = res) =>
>         s : String := convert(totalTime()$NewTimingFunctions -t)$Integer
>         messagePrint(concat([mes, " in ", s ]))$OutputForm
>       messagePrint(concat(mes, " Bad result"))$OutputForm
>
>     runFunction(f,res) ==
>       t := totalTime()$NewTimingFunctions
>       runRes := f()
>       if runRes = res
>       then ( messagePrint("foo")$OutputForm ; totalTime()$NewTimingFunctions 
> -t)
>       else 0
>
>
>

-- 
 address@hidden




reply via email to

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