[plt-scheme] Problems and Questions converting to PLaneT
The problem seems to stem from the interactions between paths and strings.
The Language Manual says: When a MzScheme procedure takes a filesystem path
as an argument, the path can be provided either as a string or as an
instance of the path datatype. If a string is provided, it is converted to a
path using string->path. A MzScheme procedure that generates a filesystem
path always generates a path value.
However this isn't true for path->string, for example. One might expect
that (path->string "abc") to return "abc". Instead it errors. I believe
that was the root cause of the problem below. A routine somewhere - I quit
when I got to a thread invoking a unit in the package installer module (it
was getting a bit deep for me) - just wanted to use the string version of a
path that was already a string.
Doug
_____
From: plt-scheme-bounces at list.cs.brown.edu
[mailto:plt-scheme-bounces at list.cs.brown.edu] On Behalf Of Williams, M.
Douglas
Sent: Tuesday, December 27, 2005 1:14 PM
To: plt-scheme
Subject: RE: [plt-scheme] Problems and Questions converting to PLaneT
I got it to work by changing the compile-subcollections in my info.ss file
to a list of list of paths. The info.ss file is now:
(module info (lib "infotab.ss" "setup")
(define name "PLT Scheme Science Collection")
(define blurb
(list "A collection of modules that provide functions for "
"numerical computing."))
(define categories '(scientific))
(define doc.txt "doc.txt")
(define primary-file "science-with-graphics.ss")
(define version "2.0")
(define compile-subcollections
(list (list (string->path "special-functions"))
(list (string->path "random-distributions"))))
)
This will correctly build the .plt and I can install it using the planet
command line.
Now I just need to know if there is a convenient way to compile it - i.e.
something similar to compile-collection-zos when something isn't actually in
the collection path.
_____
From: plt-scheme-bounces at list.cs.brown.edu
[mailto:plt-scheme-bounces at list.cs.brown.edu] On Behalf Of Williams, M.
Douglas
Sent: Tuesday, December 27, 2005 10:53 AM
To: plt-scheme
Subject: [plt-scheme] Problems and Questions converting to PLaneT
Problems and Questions converting to PLaneT - or why Jacob Matthews dreads
seeing my name in the From field of a post.
I am trying to get the PLT Scheme Science Collecting ready to distribute
using PLaneT and I am running into a few problems.
The science collection is a collection of modules plus two sub collections
(special-functions and random-distributions). The directory structure is:
science
- <many files with scheme modules, including science.ss and
science-with-graphics.ss>
- info.ss
- doc.txt
- special-functions
- <several files with scheme modules>
- info.ss
- random-distributions
- <many files with scheme modules>
- info.ss
When this is in a collects directory (and the directory is in the
collections path), I can easily compile the collection (using
compile-collection-zos) and otherwise manipulate it using tools within PLT
scheme.
In preparation to move to PLaneT, I have moved the code out of a collects
directory (that is, the directory is not in the collections path). Now the
questions.
---
What is the best way to compile the collection (and subcollections) the way
compile-collection-zos does? Or, does PLaneT automatically compile the
collection for me? (I haven't been able to get that far.)
---
In any case, I should be able to build the .plt file for distribution with
PLaneT. I used make-planet-archive to create a plt file. This seems to
work okay. (I assume that 'planet --create-archive ...' would have done the
same thing.)
When I try to install it using 'planet --file science.plt williams 2 0', I
get the following error:
build-path: expects type <path, string, 'up, 'same> as 2nd argument, given:
("sp
ecial-functions"); other arguments were: #<path:C:\Documents and
Settings\willia
msm\Application Data\PLT Scheme\planet\300\300\cache\willi...
Note that I cannot remove the package at this point. In particular, 'planet
--remove williams science.plt 2 0' gives the following:
build-path: expects type <path, string, 'up, 'same> as 2nd argument, given:
("sp
ecial-functions"); other arguments were: #<path:C:\Documents and
Settings\willia
msm\Application Data\PLT Scheme\planet\300\300\cache\willi...
with-input-from-file: cannot open input file: "C:\Documents and
Settings\william
sm\Application Data\PLT Scheme\cache.ss" (The system cannot find the file
specif
ied.; errno=2)
Both seem to be referring to one of the subcollections (in particular,
special-functions).
My info.ss file is as follows:
(module info (lib "infotab.ss" "setup")
(define name "PLT Scheme Science Collection")
(define blurb
(list "A collection of modules that provide functions for "
"numerical computing."))
(define categories '(scientific))
(define doc.txt "doc.txt")
(define primary-file "science-with-graphics.ss")
(define version "2.0")
(define compile-subcollections
(list (list "special-functions") (list "random-distributions")))
)
At first I suspected the compile-subcollections might be handled differently
for PLaneT (i.e. not a list of list of strings) so I changed its value to
(list "special-functions" "random-distributions"). This also fails with:
path->string: expects argument of type <path>; given "special-functions"
But, that might help anyway.
---
Am I doing something wrong or is this a bug?
---
Just out of curiosity, why is the order of the arguments to the --file
option different from the others with similar arguments (-- install,
--download, and --remove)?
Thanks for the help.
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20051227/e0e8b022/attachment.html>