Returning the symbol seems odd at least to me. I think the best we could do
is have a compiler flag so that defs can return nil for REPLs.

On Tuesday, May 15, 2012, kovas boguta wrote:

> Yeah, that is sort of what I was implying in "changing the semantics of
> def"
>
> Though I wasn't ready to totally committed to that, since I don't
> understand the properties of symbols in clojurescript.
>
> Like, how do go from the symbol to the javascript object we've just
> bound to the symbol?
>
>
> On Tue, May 15, 2012 at 2:26 AM, Laurent PETIT <laurent.pe...@gmail.com>
> wrote:
> > Clojurescript doesn't have vars, so why not have def return the symbol ?
> >
> >
> >
> > Le 15 mai 2012 à 06:14, kovas boguta <kovas.bog...@gmail.com> a écrit :
> >
> >> I think this is a pretty valid feature request.
> >>
> >> The main question is, can this be done without having vars in
> clojurescript.
> >>
> >> One way to do it is to surpress output somehow, under certain
> conditions.
> >>
> >> Either as a token at the end of a repl input, or in the semantics of
> def itself.
> >>
> >> I don't have an ideal specific solution here, but I've noticed this
> >> problem as well and found it pretty annoying.
> >>
> >> There should be a way to solve it that is a reasonable compromise.
> >>
> >>
> >>
> >> On Mon, May 14, 2012 at 11:13 PM, Mark Engelberg
> >> <mark.engelb...@gmail.com> wrote:
> >>> On Mon, May 14, 2012 at 4:41 PM, David Nolen <dnolen.li...@gmail.com>
> wrote:
> >>>>
> >>>> On Mon, May 14, 2012 at 7:27 PM, Mark Engelberg <
> mark.engelb...@gmail.com>
> >>>> wrote:
> >>>>>
> >>>>> (def tree (function-that-produces-an-enormous-tree 2))
> >>>>
> >>>>
> >>>> Isn't doing this at the top level bad form?
> >>>
> >>>
> >>> The purpose of a REPL is for interactive experimentation.  I want to
> give
> >>> names to the things I'm building so I can play with them in the REPL.
> >>> Nothing bad form about that.
> >>>
> >>>>
> >>>> Also I don't see how this isn't solved by modifying some habits.
> >>>>
> >>>> (defn test-tree [] (function-that-produces-an-enormous-tree 2))
> >>>> (time (test-tree))
> >>>>
> >>>
> >>> time prints out the value that is computed.  The above example would
> suffer
> >>> the same problem of printing out the tree at the REPL.  You could do
> >>> something like (time (do (test-tree) nil)) to suppress printing, but
> if you
> >>> want to do further interactive manipulations to the tree, you'd end up
> >>> recomputing it.  So then, you get into workarounds involving delay.  It
> >>> starts to get ugly, I think.
> >>>
> >>> Clojure's ability to give names to things without printing the values
> is a
> >>> feature I use every day in my interactive explorations.
> >>>
> >>>
> >>> --
> >>> 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
> >>> Note that posts from new members are moderated - please be patient
> with your
> >>> first post.
> >>> To unsubscribe from this group, send email to
> >>> clojure+unsubscr...@googlegroups.com
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/clojure?hl=en
> >>
> >> --
> >> 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
> >> Note that posts from new members are moderated - please be patient with
> your first post.
> >> To unsubscribe from this group, send email to
> >> clojure+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/clojure?hl=en
> >
> > --
> > You r

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to