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

Pages: 1-

Better C

Name: Anonymous 2012-01-08 23:01


    /*
     * BETTER_C.H  
     * Language refinements for C.
     */
    #ifndef BETTER_C_H
    #define BETTER_C_H

    /* logical/comparison operators */
    #define NE  !=
    #define EQ  ==
    #define GT  >
    #define LT  <
    #define GE  >=
    #define LE  <=
    #define AND &&
    #define OR  ||
    #define NOT !

    /* bitwise operators */
    #define bNOT ~
    #define bAND &
    #define bOR  |
    #define bXOR ^

    /* arithmetic operators */
    #define MOD   %

    /* control constructs */
    #define repeat    do
    #define until(p)  while(NOT (p))
    #define forever   while(1)
    #define untilbreak  forever
    #define untilreturn forever
    #define unless(p) if(NOT (p))
    #define ifnot(p)  if(NOT (p))
    #define do_nothing
    #define then

    #endif

Name: Anonymous 2012-01-08 23:37

How does that make it better?

Name: Anonymous 2012-01-08 23:50

That's [b]retarded[/b]. You are adding [i]unnecessary[/i] complexity and [i]unneeded[/i] syntactic sugar to a compact and simple programming language. In short, you are ruining the perfection of C.

Name: Anonymous 2012-01-08 23:54

This seems like as good a thread to post this as any.
#define unless(a) if(!(a)) makes no fucking sense.

Why does this exist?

Name: Anonymous 2012-01-09 0:28

>>4
He is probably trying to turn C into Lisp.

Name: Anonymous 2012-01-09 0:46

op have no idea of marvelous iso646.h

Name: Anonymous 2012-01-09 1:19

>>1
#
/*
 *    UNIX shell
 *
 *    S. R. Bourne
 *    Bell Telephone Laboratories
 *
 */

#define LOCAL    static
#define PROC    extern
#define TYPE    typedef
#define STRUCT    TYPE struct
#define UNION    TYPE union
#define REG    register

#define IF    if(
#define THEN    ){
#define ELSE    } else {
#define ELIF    } else if (
#define FI    ;}

#define BEGIN    {
#define END    }
#define SWITCH    switch(
#define IN    ){
#define ENDSW    }
#define FOR    for(
#define WHILE    while(
#define DO    ){
#define OD    ;}
#define REP    do{
#define PER    }while(
#define DONE    );
#define LOOP    for(;;){
#define POOL    }


#define SKIP    ;
#define DIV    /
#define REM    %
#define NEQ    ^
#define ANDF    &&
#define ORF    ||

#define TRUE    (-1)
#define FALSE    0
#define LOBYTE    0377
#define STRIP    0177
#define QUOTE    0200

#define EOF    0
#define NL    '\n'
#define SP    ' '
#define LQ    '`'
#define RQ    '\''
#define MINUS    '-'
#define COLON    ':'

#define MAX(a,b)    ((a)>(b)?(a):(b))

Name: Anonymous 2012-01-09 1:36

I can't tell if I'm horrified or I love it.

Name: Anonymous 2012-01-09 1:40

>>7
#define ORF    ||

ORF

O
R
F

Name: Anonymous 2012-01-09 2:02

Postin' in a BASIC thread!
#define do_nothing
#define then

Name: Anonymous 2012-01-11 1:44

>>4
Because Perl. You do have to twist your brain around a little bit for it to seem natural ("do unless (condition) { ... }" is how I read it), but if you've been bitten by a missing or missed ! nested inside the parens, you come to appreciate it more.

Name: Anonymous 2012-01-11 2:59

>>11
Lisp has the same thing. Even though Lisp is shit, it's still nice to have multiple ways of expressing something.

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