Enums in Scheme
1
Name:
Anonymous
2012-10-21 22:16
why they not there?
2
Name:
Anonymous
2012-10-21 22:23
(define suites '(spade club heart diamond))
3
Name:
Anonymous
2012-10-21 22:25
java enums:
private static void enum whatever bla bla bla, better not use them!
4
Name:
Anonymous
2012-10-21 22:25
stop writing C in every language
5
Name:
Anonymous
2012-10-21 22:44
You don't get the point, dickshitting tittymongler.
6
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.
7
Name:
Anonymous
2012-10-21 23:27
Because Lisp/Scheme/Haskell are inferior to C/C++/Java.
8
Name:
Anonymous
2012-10-21 23:36
>>7
oh, they're there, ``faggot''
deriving Enum
9
Name:
Anonymous
2012-10-22 0:00
Scheme is Jewish . When you hear someone is "scheming" something, what automatically pops into your head?
10
Name:
Anonymous
2012-10-22 0:16
11
Name:
Anonymous
2012-10-22 0:57
12
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.
13
Name:
Anonymous
2012-10-22 8:39
>>12
What happens if you try to add ENUM1 to ENUM2?
15
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?
16
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.
17
Name:
Anonymous
2012-10-22 13:49
>>12
That is fucking ugly.
Thank god I'm a C# dev.
18
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.
19
Name:
Anonymous
2012-10-22 14:28
>>1-18
You're all wrong.
(deftype finite-element-set-type (&rest elements)
`(member ,@elements))
20
Name:
Anonymous
2012-10-22 14:46
or just use javascript
seriously, quit wasting your time
21
Name:
Anonymous
2012-10-22 15:41
have you tried symta?
22
Name:
Anonymous
2012-10-22 20:15
23
Name:
Anonymous
2012-11-18 22:04
F I B O N A C C I B U T T S O R T
Anti-spam bump
Newer Posts