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

A few facts about Lisp and Haskell

Name: Anonymous 2011-04-18 6:59

Lisp:

* (expt -1 (exp 1))
#C(-0.6332554 0.7739428)


Haskell:

Prelude Data.Complex> (-1) ** exp 1 :: Complex Double
(-0.6332556513148192) :+ (-0.773942685266709)

Name: Anonymous 2011-04-18 7:07


Lisp                        | Haskell
----------------------------|------------------------------------------------------
* (floor (/ 1 0))           | Prelude> floor (1/0)
DIVISION-BY-ZERO signalled  | 1797693134862315907729305190789024733617976978942306572
                            | 7343008115773267580550096313270847732240753602112011387
                            | 9871393357658789768814416622492847430639474124377767893
                            | 4248654852763022196012460941194530829520850057688381506
                            | 8234246288147391311054082723716335051068458629823994724
                            | 5938479716304835356329624224137216

Name: Anonymous 2011-04-18 7:09

A big obstacle within the Lisp community is the fact that we seem to have too many right-thing thinkers, whereas it would be more healthy to stress the diversity that Lisp allows us to have.

Name: Anonymous 2011-04-18 7:21

> (expt -1 (exp 1))
-0.6332556513148192+0.773942685266709i

> (floor (/ 1 .0))
+inf.0


What's the point of this?

Name: Anonymous 2011-04-18 7:41

>>4
SBCL doesn't yield that output.

Name: Anonymous 2011-04-18 7:49

>>5
SBCL doesn't have > as prompt. That was Racket, this is MIT Scheme.
1 ]=> (expt -1 (exp 1))
;Value: -.6332556513148192+.773942685266709i
1 ]=> (floor (/ 1 .0))
Floating point exception

Name: Anonymous 2011-04-18 8:19

>>1
Works fine here (SBCL)

CL-USER> (expt -1 (exp 1))
#C(-0.6332554 0.7739428)
CL-USER> (expt -1 (exp 1.0d0))
#C(-0.6332556513148192d0 0.773942685266709d0)

If you want greater precision, you can get as much as you need if you use some implementation allowing for arbitrary precision (CLISP is one of them, but some may have it available as a library):

[1]> (setf (ext:long-float-digits) 1000)
[2]> (expt -1 (exp 1.0l0))
#C(-0.63325565131482003455221586387628567735988639211576341886045825804185702937821272120217359205393699036520823387683267699270474817719212534837635481841755448651254337491258807459118945922827840765642041394120264007413089579012984077420253480706874872203972770809833002187599896043439198998164240413021982194503L0
  0.77394268526670827825793271720774866145099893995475277126734359502621407976384339614987376269525171149625703363986531499024438903176103407856114984354038551419553115983909019787027150488923326085167062760431552788722548239917674407477700517719629900454875079046934080927802993869382237345209632790390374185827L0)

Name: Anonymous 2011-04-18 8:40

>>6
lol racket sucks.

Name: Anonymous 2011-04-18 8:42

>>7
It isn't about precission, but about haskell typesystem's incapability to infer return value.

Name: Anonymous 2011-04-18 8:55

>>8
That's MIT Scheme, idiot.

Name: Anonymous 2011-04-18 10:50

>>10
I'm talking about >>4 +inf.0, idiot.

Name: Anonymous 2011-04-18 11:01

For the floor thing,  same happens in C and standard is, for floating  point types, to evaluate 1/0 to Infinity, not to raise exception. But yeah, it is stupid.

(-1)**exp 1 correctly evaluates to NaN.

Name: Anonymous 2011-04-18 11:03

>>12
lol c/c++ sucks also.

inferior languages are inferior. they place is in a gas chamber together with their jewish inventors.

Name: Anonymous 2011-04-18 11:14

>>13
lol c/c++ sucks also.
Right.
inferior languages are inferior.
Right.
they place is in a gas chamber
Right.
together with their jewish inventors.
Get out.

Name: Anonymous 2011-04-18 11:57

>>14
I don't take orders from jewish maggots.

Name: Anonymous 2011-04-18 11:58

>>15
Fuck off and get out.

Name: nambla_dot_org_still_rules_you 2011-04-18 11:59

>>12
I thought division by 0 in C resulted in undefined behavior.

Name: Anonymous 2011-04-18 12:00

>>16
I don't take orders from jewish maggots.

Name: Anonymous 2011-04-18 12:00

Didn't C have a _Complex type?

Name: Anonymous 2011-04-18 12:01

>>16
Time to bring out the big guns now.
☣ Please try to ignore troll posts ☣
The code for this is as follows
[o][code]☣ Please try to ignore troll posts ☣ [/codd][/o]

Name: Anonymous 2011-04-18 12:02

>>20
This shabbos goy can't stand it, when I insult his jewish masters.

Name: Anonymous 2011-04-18 12:10

>>20
There's the [#] tag for that.
[o][code]☣ Please try to ignore troll posts ☣ [/code][/o]

Name: Anonymous 2011-04-18 12:11

>>22
Oh yeah, thanks. I never use it so I've forgotten it.

Name: Anonymous 2011-04-18 12:11

>>22
define "troll post"

Name: Anonymous 2011-04-18 14:09

>>9
MAW Lisp is just duck typed since Lisp has strong typing and unless you know what you're doing really well, is far more likely to be buggy. /thread

Name: Anonymous 2011-04-18 14:12

>>1
Cool story brah. Too bad I went through SICP with Haskell. /thread*2

Name: Anonymous 2011-04-18 14:21

>>26
Who cares.

>>25
Read SICP.

Name: Anonymous 2011-04-18 14:23

>>27
lol IHBT. That doesn't make sense. How could you say you don't care about a Haskeller who did SICP and then tell another one to do SICP. Stupid faggot. Go back to /g/

Name: Anonymous 2011-04-18 14:28

>>28
I don't care if you did SICP with Scheme, Haskell, APL, pencil and paper, your mother.
faggot. Go back to /g/
To accompany you there? Sure.

Name: Anonymous 2011-04-18 14:30

>>29
Then shut up about reading SICP and shut up period. This post is a pit of trolls. Ignore and move on.

Name: Anonymous 2011-04-18 14:56

>>30
There are no serious-discussion threads on /prog/ anymore, only trolls and /g/. Let me feed the trolls and shut up.

Name: Anonymous 2011-04-18 15:02

>>31
..... Fine. I'm a Haskeller and I feel adequate about the point I proved about my language. Go on and feed the trolls. No saging, I guess

Name: Anonymous 2011-04-18 15:11

>>25
Duck typing isn't a CL, that's Python.
In most Lisps, including CL, every possible language object (regardless of internal implementation) carries type with it, and variables themselves are untyped, unless you decide to go and force a type into them (for example, for optimization purposes: some compilers may even drop type information if you do that).
In my example, I just shown what happens when different types of floats are used as arguments. Common arithmetic operations are basically generic operations internally (although not so in the spec, despite supporting everything under the sun) which are optimized more heavily. Being such, they tend to support a variety of types for their arguments.

Duck typing as a style is supported in CL, for example through CLOS, but this isn't it.

Name: Anonymous 2011-04-18 15:15

>>33
This guy should read
>>31

Name: Anonymous 2011-04-18 15:16

>>17
gcc manual refers to this about infinities
http://en.wikipedia.org/wiki/IEEE_754-2008

Name: Anonymous 2011-04-18 15:20

>>34
I've been using /prog/ for serious discussion for years. It's getting pretty lonely here lately when only the spammers and low-quality trolls come.

Name: Anonymous 2011-04-18 15:22

>>36
Yeah. Well, I use Haskell, you use Lisp. Both pretty good languages. Can we just agree to agree on that and not waste time on this shit? We could be coding and learning more about our languages instead of talking about pointless bs

Name: Anonymous 2011-04-18 15:25

>>34
Don't use me as excuse to shit in /prog//say /prog/ is dead, thank you.

>>36
I know how you feel, I had some of the best discussions ever here. It's sad that now it's (again) filled with spammers and trolls.

Name: Autistic Duck 2011-04-18 15:25

My toy language is faster, longer and harder

Name: Anonymous 2011-04-18 15:27

>>37
I don't hate on languages, I hate on language advocates/fanboys.

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