I'm not really sure if there was a question in there...

> Loading all the vocabularies, which all load many other vocabularies, 
> is not easy to do. 

If you're just sitting down at your editor, typing vocab names into the
`USING:` line, then yeah, it's going to be difficult to know exactly which
vocabs you're supposed to specify.  That's why you use the listener.

Say I'm working on a file, factor/work/blah/blah.factor.  While I'm jotting
down some code, I either don't know what I need in the `USING:` or forget to
put something in there.

  USING: ; ! ???

  "Blah" print

>From the listener, I type `USE: blah`, and I get a helpful error message.

  IN: scratchpad USE: blah
  Loading resource:work/blah/blah.factor
  1: USE: blah
              ^
  resource:work/blah/blah.factor

  1: "Blah" print
                 ^
  No word named “print” found in current vocabulary search path

  The following restarts are available:

  :1      Use the io vocabulary
  :2      Defer word in current vocabulary
  :3      Load resource:work/blah/blah.factor again

  Type :help for debugging help.

It gives me several options to recover from this error, including a suggestion
for which vocab to load to find the word `print` (note that this doesn't always
work, if Factor can't find a particular word name in the current search path).
In this case, I can type `:1` to use the `io` vocab.

  IN: scratchpad :1
  resource:work/blah/blah.factor:1: Note:
  Added "io" vocabulary to search path

  Restarts were invoked adding vocabularies to the search path.
  To avoid doing this in the future, add the following forms
  at the top of the source file:

  USING: io ;

Also, take a look at http://docs.factorcode.org/content/article-images.html and
http://docs.factorcode.org/content/word-auto-use__que__%2Cparser.html

> I often have to solve problems with interdependencies. It is not easy to find
> the cause of these problems.

What sort of problems?  And what sort of interdependencies?  Like vocabs
depending on vocabs?  I struggle to think of a problem with that, because the
chain of dependencies shouldn't be an issue, unless there's a cycle.  E.g.,

  ! In a.factor
  USING: b ;
  IN: a
  : a-word ( -- ) b-word ;

  ! In b.factor
  USING: io ;
  IN: b
  : b-word ( -- ) "Called b-word" print ;

  ! At the listener
  IN: scratchpad USE: a
  Loading resource:work/a/a.factor
  Loading resource:work/b/b.factor
  IN: scratchpad a-word
  Called b-word

Notice that a.factor doesn't need to have `USING: io`, even though b.factor
does.  So you don't need to think about anything beyond a file's immediate
dependencies.  I guess there would be an issue if you had a cyclic dependency,
which needs to be resolved manually (or, more practically speaking, removed):

  ! In a.factor
  USING: b io ;
  IN: a

  : a-word1 ( -- ) b-word ;

  : a-word2 ( -- ) "Called a-word2" print ;

  ! In b.factor
  USING: a ;

  : b-word ( -- ) a-word2 ;

  ! At the listener
  IN: scratchpad USE: a
  Loading resource:work/a/a.factor
  Loading resource:work/b/b.factor
  1: USE: a
           ^
  resource:work/a/a.factor

  1: USING: b io ;
             ^
  resource:work/b/b.factor

  4: : b-word ( -- ) a-word2 ;
                            ^
  No word named “a-word2” found in current vocabulary search path

  The following restarts are available:

  :1      Defer word in current vocabulary
  :2      Load resource:work/b/b.factor again
  :3      Load resource:work/a/a.factor again

  Type :help for debugging help.
  IN: scratchpad :3
  Loading resource:work/a/a.factor
  Loading resource:work/b/b.factor
  Loading resource:work/a/a.factor
  IN: scratchpad a-word1
  Called a-word2

Maybe by "interdependencies" you mean that vocabs can step on each others'
toes?  If two vocabs define different words with the same name, there will be
an ambiguity.  To resolve, see
http://docs.factorcode.org/content/word-FROM__colon__,syntax.html

> In the developer tools I saw some interesting words for working with 
> vocabularies. There might be a solution to my problem, if I use these 
> tools, but I do not know where to start.

Which interesting words?  Sorry, I'm running out of psychic abilities.  :)

If you aren't sure what certain words do, it's helpful to browse through their
documentation.  Even if a word isn't quite what you want, there are usually
related things you can click on, looking for related words until you stumble
onto something useful.

Hope any of that helps,
--Alex Vondrak
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to