I've started an ASDF Best Practices document as a response to all the ugly stuff I saw while debugging backward incompatibilities introduced by ASDF 3.3. It is currently in my plan branch:
https://gitlab.common-lisp.net/asdf/asdf/blob/plan/doc/best_practices.md
Early feedback welcome.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org If a trainstation is where the trains stop, what is then a workstation... — Lars Lundgren d95lars@dtek.chalmers.se
On 4/1/17 06:27, Faré wrote:
I've started an ASDF Best Practices document as a response to all the ugly stuff I saw while debugging backward incompatibilities introduced by ASDF 3.3. It is currently in my plan branch:
https://gitlab.common-lisp.net/asdf/asdf/blob/plan/doc/best_practices.md
Very cool, and a needed resource to get some idea of the state of Faré's brain.
One thing I learned from reading this document is that my use of symbols to name and refer to ASDF systems is probably wrong, as it contradicts the best practice of using strings for system identity. I like using symbols because
(asdf:defsystem democracry :depends-on (civil-society press/freedom) …
looks much less cluttered than
(asdf:defsystem "capitalism" :depends-on ("profit/increasing" "internal-contradictions") …
While I can see problems stemming from what package the "democracry" symbol gets interned within, I assume that ASDF:DEFSYSTEM goes to great lengths to ensure that it is processed in a reasonable manner to guard against such problems, therefore system designators as symbols should be more or less the same as system designators as strings. Using strings as system designators seems to work fine with asdf-3.2.0.
Just to be clear, could someone please illuminate my understanding here a bit: why are strings a better practice than symbols here?
On Sat, Apr 1, 2017 at 1:54 AM, Mark Evenson evenson@panix.com wrote:
On 4/1/17 06:27, Faré wrote:
I've started an ASDF Best Practices document as a response to all the ugly stuff I saw while debugging backward incompatibilities introduced by ASDF 3.3. It is currently in my plan branch:
https://gitlab.common-lisp.net/asdf/asdf/blob/plan/doc/best_practices.md
Very cool, and a needed resource to get some idea of the state of Faré's brain.
One thing I learned from reading this document is that my use of symbols to name and refer to ASDF systems is probably wrong, as it contradicts the best practice of using strings for system identity. I like using symbols because
(asdf:defsystem democracry :depends-on (civil-society press/freedom) …
looks much less cluttered than
(asdf:defsystem "capitalism" :depends-on ("profit/increasing" "internal-contradictions") …
While I can see problems stemming from what package the "democracry" symbol gets interned within, I assume that ASDF:DEFSYSTEM goes to great lengths to ensure that it is processed in a reasonable manner to guard against such problems, therefore system designators as symbols should be more or less the same as system designators as strings. Using strings as system designators seems to work fine with asdf-3.2.0.
Just to be clear, could someone please illuminate my understanding here a bit: why are strings a better practice than symbols here?
Symbols work fine. It's just that they are not *canonical*; so it's not obviously clear that underneath, ASDF them will reduce them to a lower-case string; or that :SRc srC and "src" are the same thing. The consing and interning saved by using strings is probably minor in comparison.
It's a style issues. Others may disagree with my rule. That's a shame, but as long as they have themselves a good set of principes, that's their problem.
- Faré snuerr@tznvy.pbz [2017-04-01 02:33:38 -0400]:
Symbols work fine. It's just that they are not *canonical*; so it's not obviously clear that underneath, ASDF them will reduce them to a lower-case string; or that :SRc srC and "src" are the same thing. The consing and interning saved by using strings is probably minor in comparison.
My intuition is exactly the opposite. Since the standard Common Lisp reader is case-converting, when I see symbols, I assume that FOO, Foo and foo are the same. With strings I assume the opposite - "FOO", "Foo" and "foo" are different. I don't like name space pollution though, so, when I want case-insensitive strings, I use uninterned symbols. #:FOO, #:Foo, and :foo designate the same strings and they have sufficiently distinct syntax to be properly highlighted by Emacs and to convey the intent quite clearly.
Thanks.