kawa-commonlisp-dev
[Top][All Lists]
Advanced

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

Re: [Kawa-commonlisp-dev] Packages (4)


From: Per Bothner
Subject: Re: [Kawa-commonlisp-dev] Packages (4)
Date: Sun, 19 Jan 2014 09:15:56 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 01/19/2014 08:23 AM, Charles Turner wrote:
This patch makes the valueOf methods in LispPackage more respectful of
the ANSI standard. Test suites will come when I send the Lisp code
implementing the "package frontend". The patch might not make sense in
isolation, but it will be required later.

I notice this is redundant, because a LispPackage is a Namespace:

+    else if (name instanceof LispPackage)
+      return (LispPackage) name;

In that case, this method:
  Namespace valueOfNoCreate(Object name)
might better be moved to Namespace.java.

I realize later I've used the pattern of methods named "asTYPEOrNull".
Maybe valueOfNoCreate would be better named as asNamespaceOrNull,
for better consistency.  But we can think about that later.

This method looks strange - why are we ignoring the prefix?
And why are we calling valueOfNoCreate rather than teh 1-argument valueOf?

+  public static LispPackage valueOf(String name, String prefix) {
+    return (LispPackage) valueOfNoCreate(name);

--
        --Per Bothner
address@hidden   http://per.bothner.com/



reply via email to

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