Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Evaluation inside a package' topicStudent Support Forum > General > Archives > "Evaluation inside a package"

Next Comment >Help | Reply To Topic
Author Comment/Response
Daniele Lupo
01/31/06 6:05pm

Hi to all.

I must to write a package that contains functions to work with my thesis.

Unfortunately, I must to use a formula that's very long. So, I've decided that, instead of store that long formula, I'd like to evaluate it when the package is loaded. This is a prototype of my package:

BeginPackage["DoubleStage`"]

fun::usage = "..."

Begin["`Private`"]

Print["Formula creation: please wait..."];
prova = b+3;
Print["Formula creation: completed"];

fun[b_]:= prova;

End[]

EndPackage[]

Unfortunately, it does not work... When I load it, I write, for example:

fun[3]

It returns:

3 + DoubleStage`Private`b

instead that 6. How can I resolve this?

Thanks for answers

Daniele

URL: ,

Subject (listing for 'Evaluation inside a package')
Author Date Posted
Evaluation inside a package Daniele Lupo 01/31/06 6:05pm
Re: Evaluation inside a package Peter 01/31/06 11:12pm
Re: Evaluation inside a package Daniele Lupo 02/01/06 6:30pm
Next Comment >Help | Reply To Topic