Dear ABCL developers,
I'm currently adding source file encoding support to ASDF. It will hopefully be part of ASDF 2.21, though the plan is that anything but :utf-8 and :default requires an extension :asdf-encodings.
I didn't find any way with ABCL to detect the list of external formats, or to determine is a given keyword is an acceptable name for an external format.
How do I do that?
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org If there's a book you really want to read but it hasn't been written yet, then you must write it. — Toni Morrison [same with software, —♯f]
On Apr 9, 2012, at 03:21 , Faré wrote:
Dear ABCL developers,
I'm currently adding source file encoding support to ASDF. It will hopefully be part of ASDF 2.21, though the plan is that anything but :utf-8 and :default requires an extension :asdf-encodings.
I didn't find any way with ABCL to detect the list of external formats, or to determine is a given keyword is an acceptable name for an external format.
How do I do that?
After a quick check, I don't think we define an interface. Nor could I find something in SBCL to copy. Do you have a reference to an API we can implement?
Essentially we thunk through to the [JVM Charset implementation][1], is which each named charset is used as its natural keyword form (i.e. the JVM charset ISO-8859-1 is specified by passing the :iso-8859-1 keyword).
As an intermediate solution,
(require 'abcl-contrib) (require 'jss) (jss:hashmap-to-hashtable (#"availableCharsets" 'java.nio.charset.Charset))
will return a hashtable whose keys will be the allowable names for external formats.
"Intermediate" because I would like to keep ASDF independent of the abcl-contrib mechanism, as ASDF is a requirement of ABCL-CONTRIB, so I'd rather that we agree on an API, and I'll implement this with the Java FFI primitives that JSS is based upon.
[1]: http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html
-- "A screaming comes across the sky. It has happened before, but there is nothing to compare to it now."
After a quick check, I don't think we define an interface. Nor could I find something in SBCL to copy. Do you have a reference to an API we can implement?
I need one or two functions: * most importantly, a function asdf-encodings::find-implementation-encoding (encoding) that tells me if a keyword names a valid encoding, and if so, returns a proper value to pass as an :external-format. * optionally, a function to return the list of all available encodings; maybe taking a keyword argument that allows to distinguish between actually loaded vs potentially available encodings.
(require 'abcl-contrib) (require 'jss) (jss:hashmap-to-hashtable (#"availableCharsets" 'java.nio.charset.Charset))
will return a hashtable whose keys will be the allowable names for external formats.
"Intermediate" because I would like to keep ASDF independent of the abcl-contrib mechanism, as ASDF is a requirement of ABCL-CONTRIB, so I'd rather that we agree on an API, and I'll implement this with the Java FFI primitives that JSS is based upon.
I suppose that can do for now. This currently happens in a system called asdf-encodings that is separate from ASDF. This stricture is a good reason to keep it separate and not merge it into ASDF as was suggested. If you define an API, I'll change asdf-encodings to use it, and that won't count as a reason against merging asdf-encodings into ASDF anymore. I don't want to do a merge before asdf-encodings is stable, anyway.
Thanks for the pointer.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
On 4/11/12 5:18 PM, Faré wrote:
After a quick check, I don't think we define an interface. Nor could I find something in SBCL to copy. Do you have a reference to an API we can implement?
I need one or two functions:
- most importantly, a function asdf-encodings::find-implementation-encoding (encoding) that tells me if a keyword names a valid encoding, and if so, returns a proper value to pass as an :external-format.
- optionally, a function to return the list of all available encodings; maybe taking a keyword argument that allows to distinguish between actually loaded vs potentially available encodings.
I just pushed an implementation of SYS:AVAILABLE-ENCODINGS to [abcl SVN trunk aka abcl-1.1.0-dev][r13917]. I figure you can just use the good 'ol CL primitives like FIND, SEARCH, EVERY, et. al. on the results of this call, c'nest pas?
Let me know if you need something additional.
[r13917]: http://trac.common-lisp.net/armedbear/changeset/13917
n Mon, Apr 16, 2012 at 18:14, Mark Evenson evenson@panix.com wrote:
I just pushed an implementation of SYS:AVAILABLE-ENCODINGS to [abcl SVN trunk aka abcl-1.1.0-dev][r13917]. I figure you can just use the good 'ol CL primitives like FIND, SEARCH, EVERY, et. al. on the results of this call, c'nest pas?
You mean "N'est-ce pas?".
Let me know if you need something additional.
Wonderful! Thank you so much. Do you recommend I just assume the function is there in asdf-encodings, and tell people who complain to just update their abcl, or should I test for the symbol being present? I suppose the latter.
Is there a binary pre-release? When is the next release?
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
From a programmer's point of view, the user is a peripheral that types
when you issue a read request. — P. Williams
On Mon, Apr 16, 2012 at 18:29, Faré fahree@gmail.com wrote:
n Mon, Apr 16, 2012 at 18:14, Mark Evenson evenson@panix.com wrote:
I just pushed an implementation of SYS:AVAILABLE-ENCODINGS to [abcl SVN trunk aka abcl-1.1.0-dev][r13917]. I figure you can just use the good 'ol CL primitives like FIND, SEARCH, EVERY, et. al. on the results of this call, c'nest pas?
You mean "N'est-ce pas?".
Let me know if you need something additional.
Wonderful! Thank you so much. Do you recommend I just assume the function is there in asdf-encodings, and tell people who complain to just update their abcl, or should I test for the symbol being present? I suppose the latter.
Is there a binary pre-release? When is the next release?
Also, in what package does new Symbol(charset) create a symbol? Is it a gensym, the current package (which is it?), keyword? For my purposes, I need a keyword, but conversion is easy; however, I need to know. (And yes, I'm too lazy to learn how to build my own abcl to test it at that time; thanks for armedly bearing with me.)
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org The secret to creativity is knowing how to hide your sources. — Albert Einstein
On Apr 17, 2012, at 00:59 , Faré wrote:
[…]
Also, in what package does new Symbol(charset) create a symbol? Is it a gensym, the current package (which is it?), keyword? For my purposes, I need a keyword, but conversion is easy; however, I need to know. (And yes, I'm too lazy to learn how to build my own abcl to test it at that time; thanks for armedly bearing with me.)
[SYS:AVAILABLE-ENCODINGS now returns symbols in the KEYWORD package][r13918], which I think makes much more sense for everyone, as it allows an easier comparison with something one would actually pass as an :EXTERNAL-FORMAT.
[r13918] http://trac.common-lisp.net/armedbear/changeset/13918
If one has the Java JDK and Ant installed, building ABCL should be as simple as:
cmd$ ant
from the ABCL root directory, but I understand that the time cost is not negligible for busy developers, which is why I would like to get more release engineering resources to push more ABCL maintenance releases.
-- "A screaming comes across the sky. It has happened before, but there is nothing to compare to it now."
On Apr 17, 2012, at 00:29 , Faré wrote:
n Mon, Apr 16, 2012 at 18:14, Mark Evenson evenson@panix.com wrote:
I just pushed an implementation of SYS:AVAILABLE-ENCODINGS to [abcl SVN trunk aka abcl-1.1.0-dev][r13917]. I figure you can just use the good 'ol CL primitives like FIND, SEARCH, EVERY, et. al. on the results of this call, c'nest pas?
You mean "N'est-ce pas?".
Oui?
[…]
Do you recommend I just assume the function is there in asdf-encodings, and tell people who complain to just update their abcl, or should I test for the symbol being present? I suppose the latter.
Is there a binary pre-release? When is the next release?
We're experiencing a bit of a shortage of cycles to get the engineering done to make an abcl-1.1.0 release, so although it is currently scheduled for the beginning of May, we've repeatedly failed to get enough regressions fixed to actually push the bits out the door that meeting early May is a somewhat doubtful. On the plus side, Rudi keeps getting us closer to MOP, so it isn't like we aren't making some forward progress.
In short, please test for the presence of the symbol for the foreseeable future.
armedbear-devel@common-lisp.net