Front Page All Articles Recent Changes Random Article

Contents

Concatenative language

  • ACL
  • Ait
  • Aocla
  • Breeze
  • Callisto
  • Cat
  • Cognate
  • colorForth
  • Concata
  • CoSy
  • Deque
  • DSSP
  • dt
  • Elymas
  • Enchilada
  • ETAC
  • F
  • Factor
  • Fiveth
  • Forth
  • Fourth
  • Freelang
  • Gershwin
  • hex
  • iNet
  • Joy
  • Joy of Postfix App
  • kcats
  • Kitten
  • lang5
  • Listack
  • LSE64
  • Lviv
  • Meow5
  • min
  • Mirth
  • mjoy
  • Mlatu
  • Ode
  • OForth
  • Om
  • Onyx
  • Plorth
  • Popr
  • Porth
  • PostScript
  • Prowl
  • Quest32
  • Quackery
  • r3
  • Raven
  • Retro
  • RPL
  • SPL
  • Staapl
  • Stabel
  • Tal
  • Titan
  • Trith
  • Uiua
  • Worst
  • xs
  • XY
  • 5th
  • 8th

Concatenative topics

  • Compilers
  • Interpreters
  • Type systems
  • Object systems
  • Quotations
  • Variables
  • Garbage collection
  • Example programs

Concatenative meta

  • People
  • Communities

Other languages

  • APL
  • C++
  • Erlang
  • FP trivia
  • Haskell
  • Io
  • Java
  • JavaScript
  • Lisp
  • ML
  • Oberon
  • RPL
  • Self
  • Slate
  • Smalltalk

Meta

  • Search
  • Farkup wiki format
  • Etiquette
  • Sandbox

Factor/FAQ/Develop

I've found a bug. What should I do?

First, check Bug reports to see if its a known issue. Then, report the bug on that page, in the Concatenative IRC channel, or on the Mailing list.

How do I store my code outside of the Factor source tree?

See http://docs.factorcode.org/content/article-add-vocab-roots.html.

What are compiler errors/warnings?

See the following two help articles:

  • http://docs.factorcode.org/content/article-compiler-errors.html
  • http://docs.factorcode.org/content/article-inference-errors.html

Basically, compiler errors always indicate problems in your code and should be fixed -- however, your code will still run if it has compiler errors (but it will probably fail with some kind of runtime error).

Compiler warnings are not fatal; you should minimize their number, because they indicate words which could not be compiled with optimizations. Some words will always have warnings, namely combinators which call non-literal quotations. Combinators can be declared inline, and their callers will then compile without warnings, however. See the above two links for full details.

I tried entering some code in the listener that came from the docs or from a Factor programmer, however I get a "no word found" error. Is the code wrong?

If you invoke a word that does not exist, you get an error like the following,

( scratchpad ) fadf
1: fadf
       ^
Word not found in current vocabulary search path
"name" "fadf"

The following restarts are available:

:1    Defer word in current vocabulary

Type :help for debugging help.

However, note that the message says "Word not found in current vocabulary search path". Sometimes the word might exist, but its vocabulary won't be in the listener's search path (not all vocabularies are added by default). In that case, the error looks similar, but you get restarts:

( scratchpad ) "Hello world" <label>
1: "Hello world" <label>
                        ^
Word not found in current vocabulary search path
"name" "<label>"

The following restarts are available:

:1    Use the cpu.architecture vocabulary
:2    Use the ui.gadgets.labels vocabulary
:3    Defer word in current vocabulary

Type :help for debugging help.

In the above case, you can invoke :1 or :2 to add the cpu.architecture or ui.gadgets.labels vocabularies to the search path, as if you had typed USE: cpu.architecture or USE: ui.gadgets.labels. See http://docs.factorcode.org/content/article-errors-restartable.html for more information.

What is the difference between USE: foo and USING: foo ; ?

There is none. USING: is equivalent to multiple USE: in a row.

If I do 1 foo set at the toplevel of a file, then why does foo get in the listener give me f after loading that file?

When parsing a file and executing toplevel code, a new dynamic scope is created. If you want to have that value of foo be accessable elsewhere, use 1 foo set-global or : foo 1 ; depending on whether foo's value needs to change. You may, instead, want to make a word like : init-foo 1 foo set ; to initialize that value.

I have a word pushing a vector on the stack, and it's written as an empty vector, V{ }, in the source, but when the word runs the vector has random objects in it. What's going on?

Literals are a source of confusion for some beginners. Literals are pushed to the stack in the place they are used. A literal in Factor refers to one specific object in memory, and is not automatically cloned. If you modify a literal without cloning it, that modification will be global. For more information, see the help document about literals.

This revision created on Wed, 7 Jan 2009 19:33:06 by slava

Latest Revisions Edit

All content is © 2008-2024 by its respective authors. By adding content to this wiki, you agree to release it under the BSD license.