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

Enums in Scheme

Name: Anonymous 2012-10-21 22:16

why they not there?

Name: Anonymous 2012-10-21 22:23

(define suites '(spade club heart diamond))

Name: Anonymous 2012-10-21 22:25

java enums:

private static void enum whatever bla bla bla, better not use them!

Name: Anonymous 2012-10-21 22:25

stop writing C in every language

Name: Anonymous 2012-10-21 22:44

You don't get the point, dickshitting tittymongler.

Name: Anonymous 2012-10-21 22:47

whenever i analyse every 'feature' of java, i conclude it is better not to use it. this includes enums.

Name: Anonymous 2012-10-21 23:27

Because Lisp/Scheme/Haskell are inferior to C/C++/Java.

Name: Anonymous 2012-10-21 23:36

>>7
oh, they're there, ``faggot''
deriving Enum

Name: Anonymous 2012-10-22 0:00

Scheme is Jewish. When you hear someone is "scheming" something, what automatically pops into your head?

Name: Anonymous 2012-10-22 0:16

>>9
Larry Wall.

Name: Anonymous 2012-10-22 0:57

>>9
Sex.

Name: Anonymous 2012-10-22 7:51


(define-values
  (ENUM1
   ENUM2
   ENUM3)
  (values 0 1 2))

Just wrap this in a macro to automate returning a list of values to and there you go.

Name: Anonymous 2012-10-22 8:39

>>12
What happens if you try to add ENUM1 to ENUM2?

Name: sage the mage 2012-10-22 10:13

>>13
car and cdr.

Name: Anonymous 2012-10-22 13:10

The whole point of enums is to stop shit like

const int EAST = 0;
const int WEST = 1;

cout << EAST + WEST << endl;


Can Lisp prevent this situation?

Name: Anonymous 2012-10-22 13:34

>>15
The only issue i see is an incompetent C++ programmer who think '+' concatenates integers rather than adding.

Maybe if you used proper printf statements you'd be able to see just how stupid you are.

Name: Anonymous 2012-10-22 13:49

>>12
That is fucking ugly.

Thank god I'm a C# dev.

Name: Anonymous 2012-10-22 14:02

>>15
Where in a typical Lisp program would you need something like this?
In Scheme you can use classes, structs, or even functions that return a symbol, all of which has the benefit of being accounted for in the definitions namespace and you can't do nonsense operations on them.
You can also use symbols directly, but they are prone to typos and can become hard to manage in larger programs.

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