Hi Nikhil,

There's a tutorial in the Factor UI that describes a typical workflow.
 If you hit alt-2 and the cookbook appears, it's called "Your first
program" under "Starting points".

Here's an example.

You might decide to make a physics directory, so you'd first make this file:
extra/physics/physics.factor

(inside extra/physics/physics.factor)
USING: kernel ;
IN: physics

Now if you want a motion library, you might add a file:
extra/physics/motion/motion.factor

USING: kernel ;
IN: physics.motion


Now to load it and have f2 remember it, you do  USE: physics in the listener.

You don't have to say it's in "extra/" for the IN: word, like IN:
extra.physics, because extra/, core/, and work/ are vocabulary roots
-- Factor searches these when you USE: a vocabulary.  (work/ does not
exist by default)  You can add a new vocab root by doing this:

USING: vocabs.loader namespaces sequences ;
    "resource:secret-work" vocab-roots get push
    "/home/erg/absolute-path" vocab-roots get push

Put this in your .factor-boot-rc so that it gets loaded into your
image on bootstrap.  Then you could move your physics vocab to
~/factor/secret-work/physics/ without changing the code.  Pathnames
with ~ do not work yet.

If you don't want to wait for f2, you can do   "physics" refresh.

Some keyboard shortcuts are described in the docs (f1).  The most
helpful are ctrl-shift-e on a word name, which opens the word in your
editor, ctrl-h for help, ctrl-shift-u for all the usages of a word,
ctrl-w to walk through the code, ctrl-t to time your code.

Finally, if you're testing code in the listener, you can 'save' and
have it remember your command history so you don't lose your
interactive testing session if you crash things.

Cheers,
Doug


On 4/1/08, Nikhil Marathe <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm having a very painful editing experience in factor.
> Every time i start a session, I've to type in the path for all my sources,
> then call edit on each of them and say "pathname reload" when i save it.
>
> I read on the list, that if I just save my sources in extra/ and use USING:
> then it becomes simple. But what if my sources are in another directory, say
> ~/factor.
> How do I make factor remember my sources and the associated vocabularies.
> And refresh-all doesn't seem to refresh my modified files either, how do I
> do that?
>
> Note: I'm using gvim.
>
> Thanks,
>
> Nikhil
> -------------------------------------------------------------------------
>  Check out the new SourceForge.net Marketplace.
>  It's the best place to buy or sell services for
>  just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
>  Factor-talk mailing list
>  Factor-talk@lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to