Reported by m...@kotka.de, Dec 17, 2008
Currently import expects lists of a packages with classes, which should be imported
from the given package.
(import '(package ClassA ClassB ...) ...)
Sometimes however one just wants to import a single class from a package, but
one still has to specify the list form:
(import '(package ClassA))
use/require also allow a similar style of prefix list. However, they also allow a
shortcut in case one requires only one lib with a given prefix. The attached
patch modifies import to allow also this style of shortcut:
(import 'package.ClassA)
This change would be backward compatible.
modified-import.patch
1.3 KB Download
Comment 1 by m...@kotka.de, Dec 17, 2008
I'm sorry for the dupe. The proxy gave me an error message, so I submitted again...
Also sorry for the wrong categorisation. Should be Enhancement not Defect...
Comment 2 by richhickey, Dec 17, 2008
(No comment was entered for this change.)
Comment 3 by richhickey, Dec 17, 2008
Issue 4 has been merged into this issue.
Comment 4 by richhickey, Dec 17, 2008
(No comment was entered for this change.)
Owner: richhickey
Comment 5 by richhickey, Dec 17, 2008
I think the conditional here should test for symbol? rather than seq?, i.e. reverse
the condition. We should avoid hardwiring lists when possible.
Comment 6 by m...@kotka.de, Dec 19, 2008
Ok. Checks for symbol? now and if branches reversed.
modified-import.patch
1.3 KB Download
Comment 7 by richhickey, Dec 21, 2008
patch applied (svn 1179) - thanks!
Status: Done
Converted from http://www.assembla.com/spaces/clojure/tickets/9
Attachments:
modified-import.patch - https://www.assembla.com/spaces/clojure/documents/bRbEa2w28r3P8LeJe5afGb/download/bRbEa2w28r3P8LeJe5afGb