So, in the case where the (doc)string is placed after the param I
should expect that REPL reads that string but doesn't necesarily
evaluate it?  Where does that string go? Does it become nil?  It
wasn't passed as a nil anymore than it was passed as a docstring.

If i didn't intend the (doc)string as a docstring but the reader ate
it why is it safe to assume it should become nil and vice versa?

Following defns do not evaluate as equivalent - nor are they identical
- nor do they appear to share the same identity.
I can understand cases for passing the empty string, the empty list,
etc.  However, I have trouble understanding how it isn't an error/
exception to pass a non-empty string after the param list and have
that string be converted to nil.

;;;;============
(defn my-test
 []
()
(= my-test my-test))
;;;;============
(defn my-test
 []
(= my-test my-test))
;;;;============
(defn my-test
 []
"misplaced documentation string for my-test"
(= my-test my-test))
;;;;============
(defn my-test
 []
""
(= my-test my-test))
;;;;============

On Dec 4, 1:23 am, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:
> On Dec 4, 2008, at 12:57 AM, Mon Key wrote:
>
> > I'm sure I'm missing something....
>
> > Maybe I should re address the issue in a different way; outside of
> > `meta' what other way is there to do a *visual* check/comparison to
> > test if two otherwise identical and/or nearly identical symbols
> > contain identical slot values?
>
> 'meta' is where the doc information is stored. Why would you rule that  
> out?
>
> Assume my-test appears to have a doc string. The following expression:
>
>      (:doc (meta (var my-test)))
>
> will return the doc string if it is correctly placed or nil if it is  
> not.
>
> > In the case where the `doc' string (disregarding whether it is
> > actually a doc string or not) is placed after the param how does one
> > catch this (mis)placement when examining the `meta' on the symbol
> > returns nil?
>
> In Clojure, symbols can name things, but do not have slots for values  
> themselves. Vars are bound to values, including values that are  
> functions. Reviewing the docs about this at clojure.org may help.
>
> If I still haven't showed you how to accomplish what you're looking to  
> accomplish, please do ask again. I'm sure as a group we can get to a  
> useful answer.
>
> --Steve
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to