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

The Ultimate Language

Name: Anonymous 2012-01-26 14:07


enum action : string
{
    x = "test",
    y = "test2",
    z = "test3"
}

foreach (a; __traits(allMembers, action))
{
    if (input == a)
    {
        return mixin("action." ~ a);
    }
}


Why is /prog/ not using D? Why is *everyone* not using D?

Name: Anonymous 2012-01-26 14:10

can you explain this code? what does __traits do? what does mixin() do?

Name: Anonymous 2012-01-26 14:24

__traits returns a string array of all fields contained within action. A mixin is used to insert code at compile time; in this case it will evaluate to whatever field a currently points to. It's incredibly elegant and compact, whereas you can't even define an enum of strings in C++.

Name: Anonymous 2012-01-26 14:26

now do it in lisp, faggot

Name: Anonymous 2012-01-26 14:29

Who needs LISP when you have D?

Name: Anonymous 2012-01-26 14:39

Lisp > *

Name: Anonymous 2012-01-26 14:43

If D is a "new" C, why they still use ugly-as-fuck reserved words or functions with preceding underscores?

>>2
read http://dis.4chan.org/read/prog/1284059342

Name: Anonymous 2012-01-26 14:50

>>1
Because you can do all of that in a cleaner and more expressive language, aka Lisp. D is ugly as fuck.

Name: Anonymous 2012-01-26 14:51

__traits is a function used by the compiler. Programmers are allowed to call it for the use of compile-time reflection.

Name: Anonymous 2012-01-26 15:01

Does D have C-style macros?

Name: Anonymous 2012-01-26 15:04

>>7
Because it ``works for Python''

Name: Anonymous 2012-01-26 15:06

>>10
Macros are made redundant with mixins and template mixins.

Name: Anonymous 2012-01-26 15:20

This horrible kludge of a language is uglier than sepples.

Name: Anonymous 2012-01-26 15:20

>>1
D has GC. GC is shit. That's why I use C++.

Name: Anonymous 2012-01-26 20:52

авпып

Name: Anonymous 2012-01-26 21:39

>>14
You can choose to turn off GC entirely, or limit it to certain memory ranges.

Name: Anonymous 2012-01-27 1:12

>>12
this is what pOOPers actually believe

Name: Anonymous 2012-01-27 3:51

Because I'm a functional man.

Name: Anonymous 2012-01-27 9:48

>>16
You can do the same in java but that doesn't make it any less shitty

Name: Anonymous 2012-01-27 9:50

I use C++ because... it's C for lazier people, and C is all ya you need.

Name: Anonymous 2012-01-27 10:07

>>20
This is moronic. C is not meant for high-level application, and it shows. Check out any popular web browser, music player, game, etc. written in C to see where you should not use this language. C is a portable assembly, and as such, should be limited to a low level environment where it belongs.

Embed a higher level language into C if you want abstraction and speed.

Name: Anonymous 2012-01-27 10:56

Check my dubs!

Name: Anonymous 2012-01-27 10:58

>>21
Check out any popular web browser, music player, game, etc. written in C to see where you should not use this language.
lol

Name: Anonymous 2012-01-27 11:03

>>19
Eliminating the overhead of the GC seems pretty non-shitty to me. Also, Java is shitty because it has an OOP stick up it's ass, and it runs on a VM. D has neither.

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