[plt-scheme] planet require idea

From: Jacob Matthews (jacobm at cs.uchicago.edu)
Date: Thu Mar 20 13:06:16 EDT 2008

On Thu, Mar 20, 2008 at 9:41 AM, Carl Eastlund <cce at ccs.neu.edu> wrote:

>  Pretty good.  I think your examples would have been illustrative if
>  the owner weren't "planet"; seeing (planet planet/foo...) is a bit
>  misleading, as you're not suggesting that the term "planet" needs to
>  be repeated.

Right, sorry about that. Just for the benefit of other people who
might have gotten confused, here are the same examples again with
dherman/memoize.plt instead of planet/test-connection.plt:

(planet dherman/memoize:memoize.ss)
is equivalent to
(planet "memoize.ss" ("dherman" "memoize.plt"))

(planet dherman/memoize/1:memoize.ss)
is equivalent to
(planet "memoize.ss" ("dherman" "memoize.plt" 1))

(planet dherman/memoize/1/0:memoize.ss)
is equivalent to
(planet "memoize.ss" ("dherman" "memoize.plt" 1 0))

(planet dherman/memoize/1/>=2:memoize.ss)
is equivalent to
(planet "memoize.ss" ("dherman" "memoize.plt" 1 (+ 2)))

(planet dherman/memoize/1/<=2:memoize.ss)
is equivalent to
(planet "memoize.ss" ("dherman" "memoize.plt" 1 (- 2)))

(planet dherman/memoize/1/=5:memoize.ss)
is equivalent to
(planet "memoize.ss" ("dherman" "memoize.plt" 1 (= 5)))

(planet dherman/memoize/1/1-8:memoize.ss)
is equivalent to
(planet "memoize.ss" ("dherman" "memoize.plt" 1 (1 8)))

(planet dherman/memoize/1/1-8:subpath/subfile.ss)
is equivalent to
(planet "subpath/memoize.ss" ("dherman" "memoize.plt" 1 (1 8)))

(planet dherman/memoize/1/1-8:subpath/subfile.ss)
is equivalent to
(planet "subpath/memoize.ss" ("dherman" "memoize.plt" 1 (1 8)))
and
(planet "memoize.ss" ("dherman" "memoize.plt" 1 (1 8)) "subpath")

>  The one thing I'd suggest is changing the delimiters around version
>  numbers.  You have:
>
>  owner/package/major/minor:path
>
>  I'd prefer:
>
>  owner/package:major.minor/path

I chose the syntax I did because it reminds me of the syntax one uses
for specifying a path on a remote machine with scp; I suppose that's
kind of an idiosyncratic choice though. I definitely think the
major.minor syntax looks good, but what would the more advanced
minor-version selectors look like? 3.>=5 looks a bit messy to me.

One potential way to do it would be to introduce brackets:

owner/package:1/path
owner/package:1.5/path
owner/package:1.[<=5]/path
owner/package:1.[>=5]/path
owner/package:1.[3-7]/path

This would make the versionless spec look like:

owner/package:/path

which looks a bit ugly, but that's fine with me because I think people
shouldn't generally specify packages without at least a major version
anyway.

-jacob



>
>  The colon and period are negotiable, but the path is, well, a path,
>  and / seems like the sensible delimiter; it also means in the
>  version-nonspecific case that the only delimiter is /. (<-- period is
>  only to end the sentence)  Using distinct delimiters for the version
>  numbers set them off as different; everything else is picking a file,
>  those numbers are picking which file by that name.
>
>  Also, major.minor is how we write version numbers informally anyway,
>  it make sense to reuse the notation here, assuming we aren't allowing
>  decimal literals in our major version numbers.
>
>  --
>  Carl Eastlund
>


Posted on the users mailing list.