Serge D. Mechveliani wrote:
>
> But where to set "import", in what place of the Spad code for a package,
> or a category etc.? I do not see examples.
grep -w import src/algebra/*.spad.*
in FriCAS source directory will give you hundreds of examples.
You can put 'import' at place where other statements can appear.
Just put it befor place where you use imported functions.
> What is the meaning of import?
> If f is not imported from a package Foo, is can be used by f$Foo,
> is this so?
> If f is imported from Foo, can it be used as `f' ?
More or less. f$Foo take f from Foo even if other f exist.
if there are several f-s in scope (remember, Spad allows
heavy overloading) then Spad compiler tries them in sequence,
and takes the first one which make expression type correct.
So if you have too many f-s Spad compiler may pick wrong
one. Let me add that Spad compiler typecheck expressions
separately, so the typical outcome is type error in later
expression. So if f is heavily overloaded it may be wise
to use f$Foo form to be sure that you get correct f.
BTW: If you get type errors which make no sense the first
thing to do is to add $Foo qualifications to calls.
Sometimes after that error will go away, in most other
cases you will get sensible error message.
--
Waldek Hebisch
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.