Nasser M. Abbasi wrote:
> 
> I wanted to see if I can make Fricas read definition of function  from 
> $HOME/.fricas.input
> 
> But it does not seem to be reading this file at all. How does one know it 
> is reading the file or not?

Add a printout.  Or change some setting.

> I never used this file before.  I did the following
> 
> >cat $HOME/.fricas.input
> erfc(x) == 1 - erf(x)
>
> Now started Fricas
> ======================
> >fricas
> 
> Checking for foreign routines
> AXIOM="/usr/lib/fricas/target/x86_64-linux-gnu"
> spad-lib="/usr/lib/fricas/target/x86_64-linux-gnu/lib/libspad.so"
> foreign routines found
> openServer result 0
>                        FriCAS Computer Algebra System 
>                             Version: FriCAS 1.3.4
> 
> 
> (1) -> integrate(erfc(x),x)
>    There are no library operations named erfc 
> =======================

This a feature.  FriCAS keeps functions and variables in a
structure called frame.  You can have multiple frames.  In
fact, in normal session you will have two or more frames.
One is initial frame, init file is evaluated in this frame.
And there are user frames, where your command are evaluated.
You can switch between frames using ')frame next'.
So above you would need:

(1) -> )frame next
(3) -> erfc(x)
   Compiling function erfc with type Variable(x) -> Expression(Integer)
      

   (3)  - erf(x) + 1
                                                    Type: Expression(Integer)

Note jump in command number: each frame keeps its own numeration of
commands and I put 2 command in init file.

More generaly, init file is intended to change global settings
like expose or hide a constuctor, break handling etc.  Normally
for defining functions users are expected to use ')read' command
which works in current frame.  As Ricardo noted macros are global,
so you can use a macro.

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to