[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lexicons

From: Lars Magne Ingebrigtsen
Subject: Re: lexicons
Date: Wed, 31 Jul 2013 12:27:25 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> So maybe the solution is simply to provide prefix shorthands.
> Chose a "prefix char" (there's a good time for bikeshedding here), let's
> say | for now.  Then you could define (file-locally):
>    prefixes-alist: '(("" "mypackage-") ("gs" "gnus-summary-"))
> and then use `|foo' as a shorthand for `mypackage-foo' and `gs|bar' as
> a shorthand for `gnus-summary-bar'.

That's a lot less typing and reading, but I feel that having several
ways of denoting the same thing makes reading the code more difficult.

Common Lisp has the concept of package nicknames, so you'll call the
package `something-very-long-indeed', and have a nickname like `si'.  So
you're reading the code, seeing `si:bar', and you have to either know
what it's a nickname for, or look it up at the package definition.  And
when you get a backtrace, it'll talk about
`something-very-long-indeed:bar', which doesn't match up with the code
you're reading.  So I've stopped using package nicknames in Common Lisp.

I think the prefix concept may have the same problem.

(And we'd have to extend etags etc to parse this stuff, but that's
perhaps a minor issue.)

(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]