On Sun, Feb 8, 2009 at 5:18 AM, David Nolen <dnolen.li...@gmail.com> wrote:
>
> Sweet!

I'm glad it's working for you, and that you have figured out how to
use it despite the almost complete lack of docs.  :-P

> That said I do have one minor annoyance and that is the need to leave an
> empty bracket if you want to create a new error without inheriting from a
> previously defined error.  Very minor.

This was actually intentional.  I had a pre-release version where
those brackets were optional, but the doc-string could still be
specified.  But I was worried this would be too confusing since it
meant that if you then inserted the parent vector, that would have to
come before the doc-string, but the args vector would have to be
inserted after.

(deferror *foo* "Foo Error")
(deferror *foo* [*bar*] "Foo Error")
(deferror *foo* "Foo Error" [arg1])
(deferror *foo* [*bar*] "Foo Error" [arg1])

And perhaps worst, if you got it wrong, I may not be able to detect
the mistake:

(deferror *foo* "Foo Error")
(deferror *foo* "Foo Error" [*bar*])
(deferror *foo* "Foo Error" [*bar*] [arg1]) ; oops

That last line would be using [*bar*] as the arg vector and [arg1] as
the error object definition.

...anyway, that's reasoning behind requiring at least placeholder
empty brackets before the doc-string.  But I'm open to being persuaded
otherwise.  Perhaps allow no parent vector if there's also no
doc-string?

Oh, and by the way with an empty or missing parent vector, the error
would still be derived from kit/*error*.

> Will provide feedback on restarts when I get there.

Great!  But they're called continues.  :-)  Seriously, if you think
"restart" is a better name I'm willing to consider changing it.  But
Clojure already has retries in transactions, where code is actually
re-run from the beginning.  A "restart" doesn't re-run anything, it
just skips forward over a certain number of returns and runs an
alternate branch of code.  "continue" seemed a better description of
that to me than "restart".

--Chouser

--~--~---------~--~----~------------~-------~--~----~
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 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to