[Top][All Lists]

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

Re: with-url

From: Lars Ingebrigtsen
Subject: Re: with-url
Date: Sat, 21 Jan 2017 16:44:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Dmitry Gutov <address@hidden> writes:

> I think you're trying to magic it up too much, by adding error
> handling forms to the macro. Personally, I'd prefer to use
> condition-case to handle errors.

Nope.  You should only signal an error if you have an error, and getting
a 404 isn't an error.  

> Something else I take an issue with, is with `with-url' being a
> macro. :) That violates The First Rule of Macro Club.

Yes, the first rule is "use a macro when it makes sense".

> 1) Return a Promise value. Emacs could use a standardized Promise
> structure in other places, too.

Emacs could, but Emacs doesn't.

> 2) Basically require to use the newly-introduced threads for
> asynchrony.

Using the new threads is a trivial rewrite and doesn't affect the
signature of the macro.

Anyway, I think the best option here would be to just have an
:ignore-errors parameter to `with-url'.  In that case, the body will
just be evaluated if we get non-error response.

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

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