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

Pages: 1-

I can't get Contravariant function args

Name: Anonymous 2006-04-07 10:49

In C++ I'm having a hell of time getting these new contravariant function parameters working.

Name: Anonymous 2006-04-07 12:46

That's nice. Are you going to describe the problem or do you just want some sympathy?

Name: Anonymous 2006-04-07 13:03

>>1
Forget C++, learn Common Lisp with this book instead:
http://www.gigamonkeys.com/book/

Name: Anonymous 2006-04-08 14:51

Is anything useful ever made with lisp? The only software that pops to mind is the operating system Emacs.

Name: Anonymous 2006-04-08 14:59

>>4
The first web store software was written in CL. It was bought by Yahoo, and eventually rewritten in C++ because Yahoo's engineers suffered from parenthephobia.

Name: Anonymous 2006-04-08 15:20

>>5
How the hell do you write a web store without side-effects?

(side-effectless programming is the only advantage of Lisp as it allows scripts to run in no time at all, by simply not running them, I can see why some lazy programmers like Lisp, they don't even have to write the code at all, hahaha oh wow)

Name: Anonymous 2006-04-08 15:39

>>6
Maybe I'm just a noob (sorry), but what are those side-effects? Lisp or C++ are just programming languages, or so I thought...

Name: Anonymous 2006-04-08 16:00

>>7
A side effect is when you set one part of memory but some other part of memory gets messed up unintentionally.

Or at least that's what my high school APCS teacher taught us. It still amazes me to this day how confident he was when he said that.

Name: Anonymous 2006-04-08 16:08

>>8
You mean like not checking the bounds of your array and going past the end? What kind of sick fuck still does this nowadays?

Name: Anonymous 2006-04-08 16:23

UGH. A side effect is where a function changes the state of the program in addition to simply returning a value. They're to be avoided where convenient but there's no fucking law against them.

Name: Anonymous 2006-04-08 16:57

The state of the "world", not just the state of the program. Writing to a database may not change the state of the program itself, but it is still a side effect.

As far as handling side effects goes Lisp is probably inferior to Haskell, except for the fact that Haskell's monads take some time to master.

Name: Anonymous 2006-04-08 17:24

>>9
No, I think what he was referring to was some kind of malfunction in the computer's circuitry. I hope you realized by now that that definition is completely wrong, and that I was being sarcastic.

Name: Anonymous 2006-04-08 23:58

Side Effect free web stores are easy. Your parameters are the users get/post vars, their cookies, and their session.
All your program does is return a new session and the HTML for the user. No need to use I/O or do anything fancy.

Name: Anonymous 2006-04-09 5:33

>>13
But how do you send the HTML to the user without this "side-effect"? You still have to use a socket, or maybe sockets aren't producing side-effect?

Name: Anonymous 2006-04-09 11:51

Once computed what you do with the result is your own problem ;)

Name: Anonymous 2006-04-09 15:09

Side-effectless programming leads to far more memory consumed in operation, because you have to decide all of the new state keeping the old one intact.\

Name: Anonymous 2006-04-09 15:15

>>16
What

Name: Anonymous 2006-04-09 15:22

Yeah, imagine a complex state with 20 MB of seemingly random data. You need to "move forwards", producing the next state. To do this, you have to run a series of functions that iterate in various ways through portions of the state and decide what to change. If you can afford side effects, and the algorithm allows it, you change your state in place. If you can't have side effects, you have to produce a new 20 MB of state, then trash the old one.

Name: Anonymous 2006-04-09 18:13

I don't think you guys have any clue what contravariance means.

Name: Anonymous 2006-04-09 18:47

>>19
Something related to those bind functions?

Name: Anonymous 2006-04-09 19:54

If you can't have side effects, you have to produce a new 20 MB of state, then trash the old one.

That's the theory. In practice, any sane compiler will only alter the part of state that changed.

Name: Anonymous 2006-04-10 9:37 (sage)

>>18
Are you buzzword-man? You should write about your life here: http://www.thedailywtf.com/ they are interested :p

Name: Anonymous 2006-04-11 16:42

http://www.thedailywtf.com/

WHAT THE FUCK?  Are these people who ENJOY programming?

Name: Anonymous 2006-04-11 16:48 (sage)

>>23
You don't get it, do you?

Name: Anonymous 2006-04-11 18:53

You guys know what contravariance is right?

Name: Anonymous 2006-04-11 18:59

>>24
Like the somethingawful.com of the most pathetic or pathetic nerds?  What's there to get?

Name: Anonymous 2006-04-11 19:00

>>26 the most pathetic of pathetic nerds
fixed

Name: Anonymous 2006-04-11 19:24

>>25
of course they don't, it's world4ch!

>>26
internet fight!

Name: Anonymous 2010-03-30 11:31

[spoiler][b]RISE FROM YOUR GRAVE, NECKBEARD THREAD[/b][/spoiler]

Name: Anonymous 2010-03-30 13:11

>>25
IHBT

Name: Anonymous 2010-03-30 13:16

This thread seems to be rather heavy on the trolling, either that or posters actually have some great misconceptions about Lisp.

Name: Anonymous 2010-03-30 15:41

>>31
Perhaps it could be both?

Name: Anonymous 2010-03-30 16:41

>>31
SO YOUR SAYING NOTHING HAS CHANGED AROUND HERE IN FOUR YEARS THEN IS THAT IT?

Name: Anonymous 2010-12-17 1:34

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

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