On Tue, Nov 3, 2009 at 10:58 PM, rob r.p.l...@gmail.com wrote:
I'm pretty sure there was an example of this using continuations in
Dybvig's book on Scheme. I just flipped through it and didn't readily
find it, but I think that is where I saw it.
You can do something like this (PLT Scheme):
On Nov 3, 12:03 am, CuppoJava patrickli_2...@hotmail.com wrote:
But I'm writing a DSL for others to use. People that don't have
experience with functional programming, and for them it's easier to
have a break/return.
That doesn't seem like a good idea to me. Clojure is a functional
I'm pretty sure there was an example of this using continuations in
Dybvig's book on Scheme. I just flipped through it and didn't readily
find it, but I think that is where I saw it.
On Nov 1, 8:04 pm, CuppoJava patrickli_2...@hotmail.com wrote:
Hi,
For the purposes of a DSL that I'm writing,
Could you do this w/ a lazy seq cond? The seq terminates early if
cond x is met.
On Nov 1, 8:04 pm, CuppoJava patrickli_2...@hotmail.com wrote:
Hi,
For the purposes of a DSL that I'm writing, it would be very
convenient to have a break/return statement that early exits from a
subroutine.
On Sun, Nov 1, 2009 at 8:04 PM, CuppoJava patrickli_2...@hotmail.comwrote:
Hi,
For the purposes of a DSL that I'm writing, it would be very
convenient to have a break/return statement that early exits from a
subroutine.
I'm not sure why you need this.
The body of a function in clojure
Thanks Brian.
For my own purposes, yes I have no need for a break or return
statement.
But I'm writing a DSL for others to use. People that don't have
experience with functional programming, and for them it's easier to
have a break/return. And for me, it's easier to implement break/return
using
On Nov 3, 2:03 am, CuppoJava patrickli_2...@hotmail.com wrote:
Thanks Brian.
For my own purposes, yes I have no need for a break or return
statement.
But I'm writing a DSL for others to use. People that don't have
experience with functional programming, and for them it's easier to
have a
Hi,
For the purposes of a DSL that I'm writing, it would be very
convenient to have a break/return statement that early exits from a
subroutine.
Is it possible to implement this in Clojure? or any Lisp-like
language?
I've given it some thought and it seems it has to be a compiler level
feature.
I've given it some thought and it seems it has to be a compiler level
feature. Am I right?
You could implement Common Lisp-style return-from with a custom
exception class:
public class BlockException extends Exception {
String name;
Object val;
public BlockException(String name,
On Sun, Nov 1, 2009 at 9:14 PM, Richard Newman holyg...@gmail.com wrote:
I've given it some thought and it seems it has to be a compiler level
feature. Am I right?
You could implement Common Lisp-style return-from with a custom
exception class:
public class BlockException extends
Thanks for the pointer! I haven't considered using Exceptions to
influence the control-flow. This will work perfectly.
-Patrick
PS:
I've always found it a little strange for exception-handling to be
treated as a special case in language design. It seems like it ought
able to be expressed in
Maybe could be done using continuation passing style? (http://
en.wikipedia.org/wiki/Continuation-passing_style)
On Nov 1, 7:04 pm, CuppoJava patrickli_2...@hotmail.com wrote:
Hi,
For the purposes of a DSL that I'm writing, it would be very
convenient to have a break/return statement that
CuppoJava patrickli_2...@hotmail.com writes:
I've always found it a little strange for exception-handling to be
treated as a special case in language design. It seems like it ought
able to be expressed in terms of some simpler elements (eg. a function
Note sure exactly what you want, but you
For this to work, you'd first have to implement Common Lisp style
unquoting. :)
Heh, good catch :)
I've been switching between the two too much recently!
At least I didn't miss out the semicolons in the Java code ;)
--~--~-~--~~~---~--~~
You received this
On Mon, Nov 2, 2009 at 12:19 AM, Richard Newman holyg...@gmail.com wrote:
For this to work, you'd first have to implement Common Lisp style
unquoting. :)
Heh, good catch :)
I've been switching between the two too much recently!
At least I didn't miss out the semicolons in the Java code
15 matches
Mail list logo