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

What's wrong with this picture?

Name: Anonymous 2008-02-08 18:02

#define incl(var, count) for (int var = 0; var < (count); var++)
#define decl(var, count) for (int var = (count) - 1; var >= 0; var--)

Name: Anonymous 2008-02-08 18:06

bind f {xg,sg) = let (xf,sf) = f xg in (xf,sf++sg)

Name: Anonymous 2008-02-08 19:14

>>1
var = (count) - 1; var >= 0
WHY?

(Yes, the compiler will fix it, but it still takes longer to type than the unretarded equivalent.)

Name: Anonymous 2008-02-08 19:20

macros are for fags

Name: Anonymous 2008-02-08 20:01

>>3
Because you might want to use var as index for some array, of course.

Name: Anonymous 2008-02-08 20:04

(defmacro decl (var init &body the-body)
  `(progn
     (size_t ,var = ,init)
     (while (var--)
       ,@the-body)))

Name: Anonymous 2008-02-08 22:34

Count is reevaluated on every iteration in the first case.

Name: Anonymous 2008-02-09 2:20

>>1
incl/decl takes two parameters, var and count.
Then, in the macros body you define a `var` object. MADNESS.

Name: Anonymous 2008-02-09 2:30

>>1
Sepples

Name: Anonymous 2008-02-09 2:41

>>9
Or C99.

Name: Anonymous 2008-02-09 2:57

>>5,8
Are you stupid? You choose a variable name to be substituted in. If you want to use "var" for anything, it is undisturbed. And there is no "var" "object" defined. When you expand incl(i,3), you get for (int i = 0; i < (3); i++). Srsly, l2macros.

Name: Anonymous 2008-02-09 3:05

>>11
int i;
incl(i, 3); srsly?

Name: Anonymous 2008-02-09 3:27

>>12
No, just incl(i,3) { /* do some stuff */ }. Lol C99/Sepples.

Name: Anonymous 2008-02-09 3:31

>>13
You don't understand >>12.

Name: Anonymous 2008-02-09 5:37

Why the hell would you use so fucking retarded macros
While you are at it

#define ever (;;)
for ever scat

Name: Anonymous 2008-02-09 7:04

>>15
I had a lecturer who insisted on
#define forever for(;;)
I guess it makes sense

Name: >>15 2008-02-09 7:43

>>16
That lecturer was a fucking moron.
I would NEVER want to see such code in one of my projects.

Name: Anonymous 2008-02-09 10:50

those who can't, teach

Name: ​​​​​​​​​​ 2010-09-09 10:11

Name: Anonymous 2011-02-03 0:52

Name: Anonymous 2011-12-08 17:30

>>22
amazing dubs bro

Name: Anonymous 2011-12-08 17:30

Thanks, bro.

Name: Anonymous 2011-12-08 18:19

>>7

this, I don't know why but in every language with the for loop people persist to have the function evaluated every iteration, even if the result is constant.

Name: Anonymous 2011-12-08 18:41

>>23
#define incl(var, count) for (int var = 0, _count = (count); var < _count; var++)

Name: Anonymous 2011-12-08 18:58

>>24
Expert programmer.

Name: Anonymous 2011-12-08 19:04

>>23
How would you do it?

Name: Anonymous 2011-12-08 19:12

>>26
_count is not defined.

why there is no preprocessor command to get type of an object? it seems really useful and possible

Name: Anonymous 2011-12-08 19:15

>>27
are you stupid

Name: Anonymous 2011-12-08 19:26

>>27
Use C99

#ifdef __GNUC__
There's a typeof(identifier) macro!
#endif

Name: Anonymous 2011-12-08 19:27

>>27
int var = 0, _count = (count)



#define := =
#define for for (int
#define -> ;i <
#define do ;++i) {
#define end }

for i := 0 -> n do
  printf("fuck my pseudo-anus");
end


I enjoy using the above code, makes things alot easier to understand if you ask me

Name: Anonymous 2011-12-08 19:29

>>30
#define do ;++i) {

so what do you do when you want a do {...} while(...) loop?

Name: Anonymous 2011-12-08 19:33

>>30
#define -> ;i <

Do you enjoy dereferencing like (*my).pee?

Name: Anonymous 2011-12-08 19:35

>>30

for j := 0 -> n do
  printf("fucked your pseudo-anus");
end

Name: Anonymous 2011-12-08 19:38

>>30'
#define -> ;i <
#define := =
>implying any compiler would compile those macros

Name: Anonymous 2011-12-08 20:09

>>34
try it you'll love it

Name: Anonymous 2011-12-08 20:21

>>35
pseudo.c:3:9: error: macro names must be identifiers

doesn't compile with gcc

Name: Anonymous 2011-12-08 20:44

GCC is shit

Name: Anonymous 2011-12-08 20:56

>>33-36
Any ANSI-C compiler won't compile that, it's not a valid macro identifier per the standard.

Name: Anonymous 2011-12-08 22:24

http://rosettacode.org/wiki/Conway%27s_Game_of_Life#C

under C


#define for_x for (int x = 0; x < w; x++)
#define for_y for (int y = 0; y < h; y++)
#define for_xy for_x for_y


typical C programmers

Name: Anonymous 2011-12-08 22:45

>>37

lovin' this bbcode bb!

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