Although I'd known about the existence of Factor for a long time,
I actually started playing with it this weekend when I discovered the
Beginning Factor series of blog-posts at elasticdog.com. I haven't
written very much code so far, but I've enjoyed learning about the
language and the environment and how open and introspective the whole
thing is - I'm reminded of stories I've heard of old Lisp machines where
you could use the debugger to single-step from your application code all
the way down into the hardware drivers. :)

Anyway, one of the first things I set up was editor integration, and
I hit a bump: to open a particular file at a particular line, there's
two commands gvim will accept:

    gvim +7 foo.txt

...or:

    gvim foo.txt +7

The first syntax works all the time, the second syntax works most of the
time, and I happen to be in a situation where the second syntax doesn't
work. Naturally, the second syntax is what editors.gvim uses. I've
attached a patch to make editors.gvim use the first syntax.

The second thing I tried was configuring Vim to syntax-highlight Factor
code. I found editors.vim.generate-syntax, but it seems the vocabularies
it depends on have moved from http.server.templating to html.templates,
so I updated the code and have attached a second patch.

I also have a suggestion for the documentation: as I was playing with
things I wanted to trace through the code and watch it executing so
I could get a better idea of how it worked. In most IDEs that's the job
of the debugger, so I opened up the Factor documentation and navigated
"Environment reference" -> "Developer tools" -> "Debugging tools"... but
the only items were "Word annotations", "Unit testing" and "Listing
threads", none of which seemed appropriate. Eventually I discovered
a thing called the "Walker" was what I wanted, but it would have been
nice if it had been listed under "Debugging tools" to begin with.

Thanks for creating such a fun and fascinating programming language!
From 659a00dc2cb6efb94f440adb9e3b8a6ff5217743 Mon Sep 17 00:00:00 2001
From: Tim Allen <[email protected]>
Date: Sun, 11 Jan 2009 13:12:52 +1100
Subject: [PATCH] Make line-numbering more reliable in gvim.

---
 basis/editors/gvim/gvim.factor |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/basis/editors/gvim/gvim.factor b/basis/editors/gvim/gvim.factor
index ad6fb65..8fb4d6b 100644
--- a/basis/editors/gvim/gvim.factor
+++ b/basis/editors/gvim/gvim.factor
@@ -8,7 +8,7 @@ SINGLETON: gvim
 HOOK: gvim-path io-backend ( -- path )
 
 M: gvim vim-command ( file line -- string )
-    [ gvim-path , swap , "+" swap number>string append , ] { } make ;
+    [ gvim-path , "+" swap number>string append , , ] { } make ;
 
 gvim vim-editor set-global
 
-- 
1.5.6.3

From 4b2c99bd6a177069669468baf67716b4cbe05a2c Mon Sep 17 00:00:00 2001
From: Tim Allen <[email protected]>
Date: Sun, 11 Jan 2009 13:13:31 +1100
Subject: [PATCH] Fix USING: in editors.vim.generate-syntax

---
 .../vim/generate-syntax/generate-syntax.factor     |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/basis/editors/vim/generate-syntax/generate-syntax.factor b/basis/editors/vim/generate-syntax/generate-syntax.factor
index 325a451..74b04c3 100644
--- a/basis/editors/vim/generate-syntax/generate-syntax.factor
+++ b/basis/editors/vim/generate-syntax/generate-syntax.factor
@@ -1,6 +1,5 @@
 ! Generate a new factor.vim file for syntax highlighting
-USING: http.server.templating http.server.templating.fhtml
-io.files ;
+USING: html.templates html.templates.fhtml io.files io.pathnames ;
 IN: editors.vim.generate-syntax
 
 : generate-vim-syntax ( -- )
-- 
1.5.6.3

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to