Re: [Factor-talk] Does the location of the image file matter ?

2015-07-29 Thread Georg Simon
Am Tue, 28 Jul 2015 23:41:59 +0200
schrieb Björn Lindqvist bjou...@gmail.com:

 I'm not sure I understand you. By default, resource: is setup as an
 alias the the directory containing the image file. But you can
 override it:
 
 factor -resource-path=/bla/bla -i=factor.image
 
 Essentially, resource: is just a convenient alias and you are free
 to put your vocab roots anywhere on the filesystem. For example, you
 could add . first on the vocab roots and then you'd have a vocab
 lookup similar to how Python looks up modules.
 
It's about the existing vocabularies. They seem to disappear when I use
an image file located elsewhere. Without vocabularies the listener
crashes too. So I wrote a script scratchVocabulary.factor:
-
USING:
io io.backend io.pathnames prettyprint
;
 resource: prepend-path normalize-path . flush
 vocab: prepend-path normalize-path . flush
-
With this script I can see that vocab: is affected by the location of
the image file:
-
$ cp /home/pub/factor/factor.image .

$ factor-lang scratchVocabulary.factor
/home/pub/factor/
/home/pub/factor/core

$ factor-lang -i=factor.image scratchVocabulary.factor
/home/factor/scratchVocabulary/
/home/factor
-
The reason seems to be the value of vocab-roots:
V{
resource:core
resource:basis
resource:extra
resource:work
}
So that seems to be intended and I have to live with it.

Now I also tried overriding as you suggested. No effect:
-
$ factor-lang -resource=/home/pub/factor -i=factor.image \
 scratchVocabulary.factor
/home/factor/scratchVocabulary/
/home/factor
-
In addition I could not find any documentation about the command line
switch -resource.


signature.asc
Description: PGP signature
--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Does the location of the image file matter ?

2015-07-29 Thread Björn Lindqvist
It's because the switch is -resource-path not just -resource.

2015-07-29 9:11 GMT+02:00 Georg Simon georg.si...@auge.de:
 Am Tue, 28 Jul 2015 23:41:59 +0200
 schrieb Björn Lindqvist bjou...@gmail.com:

 I'm not sure I understand you. By default, resource: is setup as an
 alias the the directory containing the image file. But you can
 override it:

 factor -resource-path=/bla/bla -i=factor.image

 Essentially, resource: is just a convenient alias and you are free
 to put your vocab roots anywhere on the filesystem. For example, you
 could add . first on the vocab roots and then you'd have a vocab
 lookup similar to how Python looks up modules.

 It's about the existing vocabularies. They seem to disappear when I use
 an image file located elsewhere. Without vocabularies the listener
 crashes too. So I wrote a script scratchVocabulary.factor:
 -
 USING:
 io io.backend io.pathnames prettyprint
 ;
  resource: prepend-path normalize-path . flush
  vocab: prepend-path normalize-path . flush
 -
 With this script I can see that vocab: is affected by the location of
 the image file:
 -
 $ cp /home/pub/factor/factor.image .

 $ factor-lang scratchVocabulary.factor
 /home/pub/factor/
 /home/pub/factor/core

 $ factor-lang -i=factor.image scratchVocabulary.factor
 /home/factor/scratchVocabulary/
 /home/factor
 -
 The reason seems to be the value of vocab-roots:
 V{
 resource:core
 resource:basis
 resource:extra
 resource:work
 }
 So that seems to be intended and I have to live with it.

 Now I also tried overriding as you suggested. No effect:
 -
 $ factor-lang -resource=/home/pub/factor -i=factor.image \
 scratchVocabulary.factor
 /home/factor/scratchVocabulary/
 /home/factor
 -
 In addition I could not find any documentation about the command line
 switch -resource.

 --

 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk




-- 
mvh/best regards Björn Lindqvist

--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Does the location of the image file matter ?

2015-07-29 Thread Georg Simon
Am Wed, 29 Jul 2015 12:00:04 +0200
schrieb Björn Lindqvist bjou...@gmail.com:

 It's because the switch is -resource-path not just -resource.
 
My mistake. Sorry.


signature.asc
Description: PGP signature
--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Does the location of the image file matter ?

2015-07-28 Thread Björn Lindqvist
I'm not sure I understand you. By default, resource: is setup as an
alias the the directory containing the image file. But you can
override it:

factor -resource-path=/bla/bla -i=factor.image

Essentially, resource: is just a convenient alias and you are free
to put your vocab roots anywhere on the filesystem. For example, you
could add . first on the vocab roots and then you'd have a vocab
lookup similar to how Python looks up modules.

2015-07-27 8:46 GMT+02:00 Georg Simon georg.si...@auge.de:
 Am Sun, 26 Jul 2015 12:35:01 +0200
 schrieb Georg Simon georg.si...@auge.de:

 Yes, it does matter.

 http://docs.factorcode.org/content/article-io.pathnames.special.html
 
 If a pathname begins with resource:, it is resolved relative to the
 directory containing the current image (see image-path).

 If a pathname begins with vocab:, then it will be searched for in all
 current vocabulary roots (see Working with code outside of the Factor
 source
 tree).
 
 IN: scratchpad vocab-roots get .
 V{
 resource:core
 resource:basis
 resource:extra
 resource:work
 /home/factor
 }
 
 The location of the image file affects resource: and resource:
 affects vocab:

 So I now know that I have to keep all image files in the same directory?

 -- Georg

 --

 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk




-- 
mvh/best regards Björn Lindqvist

--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Does the location of the image file matter ?

2015-07-27 Thread Georg Simon
Am Sun, 26 Jul 2015 12:35:01 +0200
schrieb Georg Simon georg.si...@auge.de:

Yes, it does matter.

http://docs.factorcode.org/content/article-io.pathnames.special.html

If a pathname begins with resource:, it is resolved relative to the
directory containing the current image (see image-path).

If a pathname begins with vocab:, then it will be searched for in all
current vocabulary roots (see Working with code outside of the Factor
source
tree).

IN: scratchpad vocab-roots get .
V{
resource:core
resource:basis
resource:extra
resource:work
/home/factor
}

The location of the image file affects resource: and resource:
affects vocab:

So I now know that I have to keep all image files in the same directory?

-- Georg


signature.asc
Description: PGP signature
--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Does the location of the image file matter ?

2015-07-26 Thread Georg Simon
Factor 0.98 x86.64 (1565, heads/master-0-g592764d, Wed Dec 24 04:52:05
2014) [GCC 4.8.2] on linux

.factor-rc

USE: vocabs.loader
/home/factor/ add-vocab-root


I want to use snapshots without touching factor.image.

I made two copies of factor.image one in the same directory and one
in my local directory. Using the copy in my local directory causes an
error Vocabulary does not exist.

In the following copy from my terminal the vocabulary project seems
to do nothing as it's UI worked as expected:

$ diff /home/pub/factor/project.image project.image
$ factor-lang -run=project -i=/home/pub/factor/project.image
$ factor-lang -run=project -i=project.image
/home/factor/project/project.factor

 9: USING:
10: combinators db db.sqlite fry io kernel memory models
  ^
Vocabulary does not exist
name
 db


How should I use snapshots?

-- Georg


signature.asc
Description: PGP signature
--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Does the location of the image file matter ?

2015-07-26 Thread Björn Lindqvist
Judging by the binary name factor-lang you have the factor package
installed from my ppa. But it appears that you have a fresher image
coming from github. You probably can't mix the two versions like that.
You can try and run:

resource:db absolute-path

in the listener. It should show you a directory containing the
db.factor file. If it doesn't something is wrong. Also swap the order
of the command line arguments, it should be:
-i=/home/pub/factor/project.image -run=project.

2015-07-26 12:35 GMT+02:00 Georg Simon georg.si...@auge.de:
 Factor 0.98 x86.64 (1565, heads/master-0-g592764d, Wed Dec 24 04:52:05
 2014) [GCC 4.8.2] on linux

 .factor-rc
 
 USE: vocabs.loader
 /home/factor/ add-vocab-root
 

 I want to use snapshots without touching factor.image.

 I made two copies of factor.image one in the same directory and one
 in my local directory. Using the copy in my local directory causes an
 error Vocabulary does not exist.

 In the following copy from my terminal the vocabulary project seems
 to do nothing as it's UI worked as expected:
 
 $ diff /home/pub/factor/project.image project.image
 $ factor-lang -run=project -i=/home/pub/factor/project.image
 $ factor-lang -run=project -i=project.image
 /home/factor/project/project.factor

  9: USING:
 10: combinators db db.sqlite fry io kernel memory models
   ^
 Vocabulary does not exist
 name
  db
 

 How should I use snapshots?

 -- Georg

 --

 ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk




-- 
mvh/best regards Björn Lindqvist

--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk