Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

For you lispers out there

Name: Anonymous 2014-08-30 11:18

When I'm programming in C, I do something like this:

int result;

result = operation(x,y,z);

if (result) return ERR_CODE;

When I look at lisp, there doesn't seem to be any error evaluation or SEH. How do you handle errors in lisp?

Name: VIPPER 2014-08-30 12:18

You don't make errors in lisp, duh.

Name: Anonymous 2014-08-30 14:18

>>1
Why would you do that? Just do if (operation (x, y, z))
return ERR_CODE;

Name: Anonymous 2014-08-30 18:33

In Haskell you can use the Either monad.

Name: Anonymous 2014-08-30 18:48

There's a whole world of conditions and restarts for you to discover, son.

Name: Anonymous 2014-08-30 21:04

>>1
With conditions and restarts, which is a more powerful version of exception handling as found in C++, Java, etc.

Scheme also has exception handling built in and undelimited continuations.

Name: Anonymous 2014-08-30 21:09

>>4
Either monad.

Any sufficiently complicated Haskell or ML program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Lisp.

Name: Anonymous 2014-08-30 21:24

>>7
Show me a Lisp where IO actions are not allowed in STM transactions. Can't? Thought so. Lisp is a slow implementation of half of Haskell.

Name: Anonymous 2014-08-30 23:25

>>8
History isn't on your side.

Name: Anonymous 2014-08-31 14:31

>>9
Geography is fucking your mother.

Name: Anonymous 2014-09-02 14:56

>>3
Well, yeah, that was sloppy. I'm accustomed to something more like

if (result) return result;

where a variable is actually justified. But that's not a real bit of stupidity. Here's some stupidity, fresh from my brain:

buff == (char *)malloc(...);

Thank God for a polite compiler warning.

>>5,6
Thanks dudes. Now I will go and find out what those are before I continue never using lisp.

>>9
You're arguing over whether lisp or Haskell won? Am I not getting irony again? I tend to do that.

Name: Anonymous 2014-09-02 17:19

>>8
https://en.wikipedia.org/wiki/Qi_(programming_language)

>>11
Lisp is dead, but sloppy dynamically typed scripting languages have won over functional and type safety in other popular languages don't come close to Haskell, which doesn't come close to Agda.

Name: Anonymous 2014-09-02 17:35

>>1
When I look at lisp, there doesn't seem to be any error evaluation or SEH. How do you handle errors in lisp?
Continuations. Although naive use of continuations can easily break RAII.

Name: Anonymous 2014-09-02 17:38

>>13
Common lisp uses function `signal`, which is like setcontext() a circumcised version of call/cc
http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html

Name: Anonymous 2014-09-02 19:04

>>12
Lisp is dead
You must be new here.

>>14
a circumcised version of
Which means it's better.

Name: Anonymous 2014-09-02 21:10

>>15

Shalom!Shalom!SHALOM! SHALOOOOOOOOOOOOM! THE BIGGEST SHALOM EVER!

Name: Anonymous 2014-09-02 21:21

>>15-16
I HAVE A BIGGER SHALOM!

Name: Anonymous 2014-09-02 21:36

>>15

skurwysyn

Name: Anonymous 2014-09-02 23:30

You need to write your own type system and implement the Maybe monad.

Name: Anonymous 2014-09-03 0:54

>>15-17
You guys are my heroes.

Don't change these.
Name: Email:
Entire Thread Thread List