Hi Andrew,
It would help if you attached some code, but you should be able to get your
code to work if you put the files in the work folder of Factor like this:
/work/ant/ant.factor
/work/antfarm/antfarm.factor
When you USE: ant, it will look through the vocabulary roots (core,
basis, extra,
Is there an import command that doesn't require moving my files into the
Factor work directory?
I like version controlling my scripts and it would be a pain to copy them
from my git directory over to work and back.
Cheers,
Andrew Pennebaker
www.yellosoft.us
On Fri, Aug 19, 2011 at 3:28 AM,
You can add your own vocabulary root, and if you put it in .factor-boot-rc then
it will get run every time you bootstrap:
USE: vocabs.loader
/Users/erg/sekrets add-vocab-root
Doug
On Aug 19, 2011, at 8:26 AM, Andrew Pennebaker wrote:
Is there an import command that doesn't require moving my
On Aug 19, 2011, at 8:36 AM, Doug Coleman wrote:
You can add your own vocabulary root, and if you put it in .factor-boot-rc
then it will get run every time you bootstrap:
.factor-boot-rc only gets loaded once when you rebuild Factor. A better idea is
to list your root directories in
On Aug 19, 2011, at 8:26 AM, Andrew Pennebaker wrote:
Is there an import command that doesn't require moving my files into the
Factor work directory?
I like version controlling my scripts and it would be a pain to copy them
from my git directory over to work and back.
As Doug indicated,
I made ~/.factor-roots with a dot (.) to indicate it should search the
current directory for Factor files, but it doesn't seem to help.
Is there a way to add the current directory to ~/.factor-roots similar to
Java's CLASSPATH?
Cheers,
Andrew Pennebaker
www.yellosoft.us
On Fri, Aug 19, 2011 at
On Aug 19, 2011, at 11:35 AM, Andrew Pennebaker wrote:
I made ~/.factor-roots with a dot (.) to indicate it should search the
current directory for Factor files, but it doesn't seem to help.
Is there a way to add the current directory to ~/.factor-roots similar to
Java's CLASSPATH?
. is
On Aug 18, 2011, at 8:07 PM, Andrew Pennebaker wrote:
USE: ui.backend.cocoa.tools menu-run-files successfully brings up an open
dialog which loads Factor code.
There might an FFI bug in the compiler. What does USE: cpu.x86.features
sse-version report?
-Joe
smime.p7s
Description: S/MIME
$ factor
( scratchpad ) USE: cpu.x86.features sse-version
--- Data stack:
41
Cheers,
Andrew Pennebaker
www.yellosoft.us
On Fri, Aug 19, 2011 at 2:48 PM, Joe Groff arc...@gmail.com wrote:
On Aug 18, 2011, at 8:07 PM, Andrew Pennebaker wrote:
USE: ui.backend.cocoa.tools menu-run-files
There must be a more dynamic way than configuring Factor for every piece of
code I write. What if Factor interpreted . as the directory from which
Factor was called?
Cheers,
Andrew Pennebaker
www.yellosoft.us
On Fri, Aug 19, 2011 at 2:46 PM, Joe Groff arc...@gmail.com wrote:
On Aug 19, 2011,
On Aug 19, 2011, at 2:57 PM, Andrew Pennebaker wrote:
There must be a more dynamic way than configuring Factor for every piece of
code I write. What if Factor interpreted . as the directory from which
Factor was called?
I'm not sure what you mean by the directory from which Factor was
On Aug 19, 2011, at 2:57 PM, Andrew Pennebaker wrote:
There must be a more dynamic way than configuring Factor for every piece of
code I write. What if Factor interpreted . as the directory from which
Factor was called?
If you're trying to load modules relative to a main script file, a bit
The parse-time trick is helpful, but it's not perfect. I'm getting an error:
Generic word length does not define a method for the source-file class.
If you're familiar with Ruby's require or Python's import, they look in
the user's current directory, i.e.
C:\CoolStuff\ python coolstuff.py
will
On Aug 19, 2011, at 3:51 PM, Andrew Pennebaker wrote:
The parse-time trick is helpful, but it's not perfect. I'm getting an error:
Generic word length does not define a method for the source-file class.
Oops, that was a typo on my part. Should be:
USING: accessors io.pathnames namespaces
The RELATIVE trick looks promising. Though, it gives me an error.
scriptedmain.factor
https://github.com/mcandre/scriptedmain/blob/master/scriptedmain.factor
test.factor
https://github.com/mcandre/scriptedmain/blob/master/test.factor
$ ./test.factor
Loading /Users/andrew/.factor-rc
On Aug 19, 2011, at 5:14 PM, Andrew Pennebaker wrote:
The RELATIVE trick looks promising. Though, it gives me an error.
scriptedmain.factor
https://github.com/mcandre/scriptedmain/blob/master/scriptedmain.factor
test.factor
https://github.com/mcandre/scriptedmain/blob/master/test.factor
Could you tweak the RELATIVE macro so that it doesn't require blob.factor to
be in blob/ ?
Cheers,
Andrew Pennebaker
www.yellosoft.us
On Fri, Aug 19, 2011 at 8:22 PM, Joe Groff arc...@gmail.com wrote:
On Aug 19, 2011, at 5:14 PM, Andrew Pennebaker wrote:
The RELATIVE trick looks promising.
You could define this syntax word:
SYNTAX: INCLUDE: scan-object parse-file append ;
Then use it:
INCLUDE: foo.factor
It adds all words from foo.factor into the current vocab.
On Fri, Aug 19, 2011 at 6:06 PM, Andrew Pennebaker
andrew.penneba...@gmail.com wrote:
Could you tweak the
I'm trying to tweak INCLUDE so that it appends .factor for you (and
thereby looks more natural, like USE/USING).
$ cat ~/.factor-rc
! An INCLUDE macro that imports source code files in the current directory
USING: accessors io.pathnames namespaces source-files vocabs.loader parser
sequences ;
Try with a string:
INCLUDE: scriptedmain
On Fri, Aug 19, 2011 at 6:53 PM, Andrew Pennebaker
andrew.penneba...@gmail.com wrote:
I'm trying to tweak INCLUDE so that it appends .factor for you (and
thereby looks more natural, like USE/USING).
$ cat ~/.factor-rc
! An INCLUDE macro that
Hi Andrew,
On Fri, Aug 19, 2011 at 8:26 AM, Andrew Pennebaker
andrew.penneba...@gmail.com wrote:
Is there an import command that doesn't require moving my files into the
Factor work directory?
I like version controlling my scripts and it would be a pain to copy them
from my git directory over
Egads, it works! Thanks to Joe, John, and Slava, I've made a little macro
pair that emulates Ruby's require in Factor's USE/USING fashion.
$ cat ~/.factor-rc
! Andrew Pennebaker
! INCLUDE/INCLUDING macros that import source code files in the current
directory
USING: kernel vocabs.loader parser
On Aug 19, 2011, at 8:30 PM, Andrew Pennebaker wrote:
It would really be neat if you didn't have to use INCLUDE/INCLUDING for user
code and USE/USING for Factor's standard library code.
The differences are:
- INCLUDE: looks only in the current directory; USE: looks in the search path
-
Hi Andrew,
On Fri, Aug 19, 2011 at 8:30 PM, Andrew Pennebaker
andrew.penneba...@gmail.com wrote:
It would really be neat if you didn't have to use INCLUDE/INCLUDING for user
code and USE/USING for Factor's standard library code.
Well, using vocabulary roots you can use USING: for everything.
On Aug 19, 2011, at 9:46 PM, Slava Pestov wrote:
Well, using vocabulary roots you can use USING: for everything. Read
the article I linked you to, it's pretty easy to add your own
directories to the search path.
Well, Andrew is objecting to a couple of things with how the vocab loader works:
25 matches
Mail list logo