do you const OR const do you
category: general [glöplog]
Quote:
Code:int*(*const*T[])(int*,struct T{void*const y;}*volatile*const volatile[]);
Okay, it's late, and I think I just blew my mind, but here's my stab at it:
T is an array of implicit length 1 of constant pointers to functions which return a pointer to an integer and take the parameters: pointer to int, volatile pointer to volatile pointer to constant pointer of a structure comprised of a constant pointer to void called y. :)
it's pretty close, but no cigar :)
sod it!!!!
a 1 length array of constant pointer to pointer of functions each returning an int* with parameters:
int* and a volatile pointer to a volatile pointer to a constant array of structure T which contains a const void pointer y
this thing is killing me
a 1 length array of constant pointer to pointer of functions each returning an int* with parameters:
int* and a volatile pointer to a volatile pointer to a constant array of structure T which contains a const void pointer y
this thing is killing me
xwize, nope :)
![BB Image](http://www.ukdemoscene.org/wizard/Projects/adam.jpg)
Everyone knows real men use assembly language...
Seriously, though, what ps said. The only places where const is trouble-free are as a replacement for #define and as a note-to-self not to update state in certain member functions like Render(). Anything else is a waste of time. In those cases, does it really matter where const goes?
Seriously, though, what ps said. The only places where const is trouble-free are as a replacement for #define and as a note-to-self not to update state in certain member functions like Render(). Anything else is a waste of time. In those cases, does it really matter where const goes?
ryg then again, I'd shoot any coworker attempting to write such a type!
Especially since there's no way in C to use the type system as an automata of its own :]
Especially since there's no way in C to use the type system as an automata of its own :]
It is a wormhole leading to another dimension where insane compilers rule the earth. I'd shoot him. srsly.
But there's nothing like the good old
But there's nothing like the good old
Code:
anyway(const char *)(this+7)
Quote:
Seriously, though, what ps said. The only places where const is trouble-free are as a replacement for #define and as a note-to-self not to update state in certain member functions like Render(). Anything else is a waste of time. In those cases, does it really matter where const goes?
It does if you're writing code which other people will use.
rarefluid, do you really mean "(const char *)(this+7)", or is it "((const char *) this + 7)" instead? :)
Quote:
It does if you're writing code which other people will use.
... or when simply passing parameters by reference. Many modern compilers don't like non-const refs to temporaries very much.
haha, xwize, go :)
seriously, though, maybe I can try to elighten you ryg: you don't necessarily need such a low-level horrible-syntax dark-cornerstones language even if you deliberately want to write such obfuscated code :)
(and no, before you ask, I'm not thinking of perl or even apl...)
seriously, though, maybe I can try to elighten you ryg: you don't necessarily need such a low-level horrible-syntax dark-cornerstones language even if you deliberately want to write such obfuscated code :)
(and no, before you ask, I'm not thinking of perl or even apl...)
that makes me wonder, has a demo already been made or partially made with a homemade language, or has a compiler design freak already made his own compiler only to build some special demo effects (AI or else...) ? :D
Zest: yes.
this is ART :)
Zest: I remember some hungarian guy having his own homegrown pascal/c/assembly (or pascal/basic/assembly?) mixture or something like that (back in the mid-90s), and coding intros in that...
I don't think however that it's meaningful to build a compiler "to build some special demo effects (AI or else...)". I mean, a new language won't enable you making new effects, just (possibly) make them easier.
I don't think however that it's meaningful to build a compiler "to build some special demo effects (AI or else...)". I mean, a new language won't enable you making new effects, just (possibly) make them easier.
yup, actually i was thinking of Lisp for AI people, but lisp is already history, i have no idea what state-of-the-art AI people use nowadays, except that i know that AI engineers in game development usually use interpreted script languages like unrealscript, quakeC or open-source LUA...
building one's own compiler or virtual machine is like reinventing the wheel but demo is all about its masterwork not its purpose, right ? ;)
unless obfuscation is sought, as a custom vm is a good protection against curious crackers :)
building one's own compiler or virtual machine is like reinventing the wheel but demo is all about its masterwork not its purpose, right ? ;)
unless obfuscation is sought, as a custom vm is a good protection against curious crackers :)
AI today is very different from what it used to be. Pure symbolic AI (where Lisp could have some advantages) seems to be a dead end. So Lisp has no particular advantages in the AI field today, I think (apart from being a somewhat high-level language).
(I didn't mean it's useless to write a compiler - it should be a very good learning experience - but that it's useless to write a compiler for the sake of building new effects)
(I didn't mean it's useless to write a compiler - it should be a very good learning experience - but that it's useless to write a compiler for the sake of building new effects)
ryg. suit yourself, but you could never beat my coworkers at writing crappy code that leaks and breaks like an old bucket. My current job (const)antly gives me new insights "how to absolutely NOT do it"... :(
But on the other side they're pretty creative in crapping the codebase up ;)
But on the other side they're pretty creative in crapping the codebase up ;)
zest, you could sortof count plenty horrible scripting languages that the world's demosystems spawned. though i guess few were turing complete of sorts.
ah yeah if a demosystem timeline script need real custom parsing, it's already a step towards compiling art, but not yet a full language/interpreter/compiler. So there have been or are demo scripting systems that aim at emulating a complete turing system ?
aren't loonies 4k intros made with some sort of bytecodes?
Quote:
aren't loonies 4k intros made with some sort of bytecodes?
Well, atleast TBL uses the WinUAE VM.
stefan aren't intel cpu(s) nowadays anyway just pretending to be x86?