Clojure

GC Issue 5: Allow single classes in import

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

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

People

  • Assignee:
    Unassigned
    Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: