[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ELisp futures and continuations/coroutines
From: |
Ted Zlatanov |
Subject: |
Re: ELisp futures and continuations/coroutines |
Date: |
Tue, 24 May 2011 21:17:51 -0500 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) |
On Sat, 21 May 2011 00:49:09 +0900 SAKURAI Masashi <address@hidden> wrote:
SM> I employed the anaphoric macros to simulate the method chains in
SM> conventional OOP languages or the "do" syntax in Haskell. I feel
SM> that it is not so good too. I would learn the better ideas.
Perhaps you can use macros to simplify things, so instead of
(deferred:$
(deferred:url-retrieve "http://www.gnu.org")
(deferred:nextc it
(lambda (buf)
(insert (with-current-buffer buf (buffer-string)))
(kill-buffer buf))))
the user could say (when we're specifically working with URL retrieval)
(deferred:do-url
"http://www.gnu.org" ;; string implies url-retrieve
;; lambda implies "nextc it" so the following two are equivalent
(lambda (buf) ...)
(nextc it (lambda (buf) ...))
but this is just an idea. I don't mean to tell you how it should work
and IMO it's usable as is. Other, more experienced Lisp programmers
should tell you what they think because I'm just a beginner.
Ted
- Re: ELisp futures and continuations/coroutines, (continued)
- Re: ELisp futures and continuations/coroutines, Stefan Monnier, 2011/05/23
- Re: ELisp futures and continuations/coroutines, Ted Zlatanov, 2011/05/24
- Re: ELisp futures and continuations/coroutines, Ted Zlatanov, 2011/05/31
- Re: ELisp futures and continuations/coroutines, Ted Zlatanov, 2011/05/31
- Re: ELisp futures and continuations/coroutines (was: more url-utils?), SAKURAI Masashi, 2011/05/19
- Re: ELisp futures and continuations/coroutines, Ted Zlatanov, 2011/05/19
- Re: ELisp futures and continuations/coroutines, SAKURAI Masashi, 2011/05/20
- Re: ELisp futures and continuations/coroutines,
Ted Zlatanov <=