Factor programming :

I've just started studying Factor programming language, here are a few of my notes so far.

Table of contents:

  • Editing your Factor code

    Editing your Factor code

    Some notes on how to play with Factor with your favorite editor.

    Setting-up e texteditor

    I'll be using e-texteditor, because Factor comes with an included TextMate bundle. But be aware that there are unsupported actions under Windows inside the menu.

    I've made a special etexteditor.factor file for factor, you'll find it here.

    You'll have to create a file ~/.factor-rc. Windows explorer can't create a file that starts with a . , so this little python script will handle the task :

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    
    conf = """USING: namespaces editors.etexteditor ;"""
    
    f = open('.factor-rc','w')
    f.write(conf)
    f.close()
    

    Put this in your C:\Documents and Settings\user-name directory and run it once, it will then create a .factor-rc.

    Now, supposed you have a vocabulary inside work/palindrome and a word palindrome?, just type the following to edit your word definition:

    USE: palindrome
    \ palindrome? edit
    

    e-texteditor will then be called by Factor, you must see something like this :

    etexteditor

    Note : I have a problem when editing a word, _e opens the file it is in but also another one called "-n9*" : I really don't know what's that.

    Using EMacs's FUEL mode

    Fuel in action

    A better alternative (for me) is to use the new EMacs's FUEL mode. It comes bundled with factor, inside the /misc directory.

    I've made a little cheatsheet for FUEL, you'll find it here : the FUEL cheatsheet

    Comments
    Back to index
    blog comments powered by Disqus

Atom feeds