hyln9 / ikarus

Optimizing incremental native-code compiler for R6RS scheme. This is a forked repository.
https://launchpad.net/ikarus
Other
5 stars 0 forks source link

Request: library's file-name encoding follow PLT's #229

Closed hyln9 closed 10 years ago

hyln9 commented 10 years ago

Higher code-point characters get encoded weird:

Ikarus Scheme version 0.0.3+ (revision 1645, build 2008-10-22) Copyright (c) 2006-2008 Abdulaziz Ghuloum

(import (λ)) Unhandled exception Condition components:

  1. &error
  2. &who: expander
  3. &message: "cannot locate library in library-path"
  4. &library-resolution: library: (λ) files: (... "./%rB.sls" ...)

While I don't think Ikarus's current way has an issue about any possible library names (i.e. any possible symbols) not having an unambiguous file-name encoding, I think it would be nicer to follow PLT's encoding [1] both because I think it's better and because it makes managing file-names across the two systems easier. Excerpt:


To ensure that all R6RS library names can be converted to a unique and distinct library module path, the following conversions are applied to each symbol before concatenating them:

* The symbol is encoded using UTF-8, and the resulting bytes are treated as Latin-1 encoded characters. ASCII letters, digits, +, -, and _ are left as-is; other characters are replaced by % followed by two lowercase hexadecimal digits. Note that UTF-8 encodes ASCII letters, digits, etc. as themselves, so typical library names correspond to readable module paths.

[1] http://docs.plt-scheme.org/r6rs/libpaths.html

Launchpad Details: #LP287909 Derick Eddington - 2008-10-22 23:25:45 -0400

hyln9 commented 10 years ago

I agree that the higher-numbered characters are not encoded properly. Will fix that.

I won't follow the PLT convention to the letter, however, because I'm not going to require a directory structure (or "collects" in PLT lingo) for top-level libraries. I like having (acme) go to "acme.ss" without a silly directory between us. As long as there compatibility intersection between implementations is large, I don't see a problem having some "flavors".

Launchpad Details: #LPC Abdulaziz Ghuloum - 2008-10-23 00:52:50 -0400

hyln9 commented 10 years ago

On Thu, 2008-10-23 at 04:52 +0000, Abdulaziz Ghuloum wrote:

I won't follow the PLT convention to the letter, however, because I'm not going to require a directory structure (or "collects" in PLT lingo) for top-level libraries. I like having (acme) go to "acme.ss" without a silly directory between us.

I like that too.

Launchpad Details: #LPC Derick Eddington - 2008-10-23 01:37:18 -0400

hyln9 commented 10 years ago

The messed up encoding was fixed some time last week, the other issues with special characters ("." and friends) are active in bug 288003.

Launchpad Details: #LPC Abdulaziz Ghuloum - 2008-10-29 14:54:52 -0400