[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: source-ing files vs. entering on cmd line?
From: |
Mario Storti |
Subject: |
Re: source-ing files vs. entering on cmd line? |
Date: |
Tue, 17 Nov 1998 17:45:41 -0300 |
>>>>> On Tue, 17 Nov 1998 14:39:49 -0600 (CST),
>>>>> "John W. Eaton" <address@hidden> said:
> On 17-Nov-1998, Daniel Friedman <address@hidden> wrote:
> | I am running Octave version 2.0.13. Suppose I start Octave while in
> | directory 'foo', and I have a file in ./bar/mstuff.m I wish to run,
> | to declare a bunch of special functions at the beginning of a particular
> | session. Without adding the 'bar' directory to LOADPATH, since I need
> | the bar directory only once, is there a way to specify to octave where to
> | look for mstuff.m just one time? If I could enter "bar/mstuff" on the
> | command line, that would be great, but this of course doesn't work.
> The reason that you can't do that is that there is no way for Octave
> to know that what you've typed is not a division expression.
> | Do
> | I have to change to the bar directory, run mstuff, and then change back
> | where I was?
> |
> | I tried source("bar/mstuff"), and this executes without error, but the
> | functions defined in mstuff are not remembered by Octave for later use.
> As Mario Storti noted, you need to give the full name of the file:
> source ("bar/mstuff.m");
> That you don't get an error when the file name is wrong looks like a
> bug. I think the following patch should fix the problem.
> Thanks,
> jwe
Well. Now, I see that I found the correct answer by pure
'serendipity'.
>From the WordNet dictionary:
> The noun serendipity has 1 sense (no senses from tagged texts)
>
> 1. serendipity -- (accidental sagacity; the faculty of making
> fortunate discoveries of things you were not looking for) .
Mario