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

Pages: 1-4041-

Preprocessor

Name: Anonymous 2011-12-31 17:17

Why do higher level languages not have a preprocessor?

It's a very powerful tool that every language should have.

Name: Anonymous 2011-12-31 17:33

It conflicts with ENTERPRISE QUALITY

Name: Anonymous 2011-12-31 18:14

Haskell has it and Haskell is fucking awesome.

Name: Anonymous 2011-12-31 18:21

Because good high-level languages (Lisp) don't need one.

Name: Anonymous 2011-12-31 18:33

Implying they dont'
http://www.slashdev.ca/javapp/

Name: Anonymous 2011-12-31 18:37

>>4
Ironically, Lisp is the one that needs it the most.

Name: Anonymous 2011-12-31 18:38

>>5

public class Poo {
   public static void main(String[] args) {
      //#if defined(poo)
      System.out.println("Poo is ${poo}");
      //#else
      System.out.println("Poo is not defined");
      //#endif
 
      //#if ${os_version} == 4.1
      System.out.println("OS 4.1");
      //#elif defined(poo) and ${os_version} >= 4.2
      System.out.println("OS 4.2 and above");
      System.out.println("Ooooh; compound expressions");
      //#endif
   }
}


that's pig disgusting.

Name: Anonymous 2011-12-31 18:59

>>7
What the flying fuck.

Name: Anonymous 2011-12-31 20:37

>>7

ewwwww

Name: Anonymous 2012-01-01 0:29

>>4
>>6

what the hell are you guys talking about.

lisp macros are like a preprocessor only better.

Name: >>4 2012-01-01 0:47

>>10
That's exactly what I'm talking about, retard.

Name: Anonymous 2012-01-01 1:02

>>10
>>11
can you
#define Faggot int

Name: Anonymous 2012-01-01 1:12

>>12
(define-symbol-macro faggot int)

Name: Anonymous 2012-01-01 1:19

>>13
can you do this:
#define suck_my_dick_and_call_me_willy #define
suck_my_dick_and_call_me_willy david int main() { \
                                       puts("suck it"); \
                                       return 0;
                                     } \

david

Name: Anonymous 2012-01-01 1:22

>>14
fix:
return 0; \

Name: Anonymous 2012-01-01 1:32

>>14
Why would you even want to? I'm guessing you're a pretty bad programmer if you're impressed that the C preprocessor can do simple string substitution.

(defmacro suck-my-dick-and-call-me-willy (name &body body)
  `(defmacro ,name () ,@body))


Can C do this?

(defmacro m () (read))

It prompts for an expression at compile time, and compiles whatever expression you type in into the code.

Name: Anonymous 2012-01-01 1:48

it's a good feature iff python has it

Name: Anonymous 2012-01-01 1:48

>>16

write a program that takes an input, saves it into the source, and re-compiles itself? (what can't C do... ;)

btw seems hardly more useful than #14's code

Name: Anonymous 2012-01-01 1:52

Why not just write your own preprocesser and invoke it before compiling? Seriously, it isn't that difficult.

Name: Anonymous 2012-01-01 2:05

>>18
write a program that takes an input, saves it into the source, and re-compiles itself? (what can't C do... ;)
Then you're just writing your own preprocessor. Also, that argument is like claiming that all languages are equally powerful because they're Turing complete. Of course it's possible to do something like that in C, what matters is how easy it is.

btw seems hardly more useful than #14's code
I didn't say it was useful. My point is that, unlike C's preprocessor, Lisp's macro system is not just a slightly more powerful sed.

Name: Anonymous 2012-01-01 2:07

>>16

omygoodness, that's pretty kewl.

Name: Anonymous 2012-01-01 2:09

import computer program

Name: Anonymous 2012-01-01 2:15

>>19

yeah, it can be done, but it is a pain. If those types of capabilities are built into the language, then implementing it will be whole lot easier, and you wont need to worry about bundling your preprocessor with your code. Also, if people use standard macro writing facilities instead, it will be a lot easier to use macros from multiple writers. It would be much more difficult to try to use two different people's preprocessors. The two preprocessors might even by incompatible if they get hung up on each other's syntax.

Name: Anonymous 2012-01-01 2:37

...Was / could lisp be implemented in C?

Name: Anonymous 2012-01-01 2:40

>>24
original lisp compilers

Name: Original‮psiL ‭ 2012-01-01 6:58

Faggots

Name: Anonymous 2012-01-01 8:52

>>16
It prompts for an expression at compile time, and compiles whatever expression you type in into the code.
#include </dev/stdio>

Name: Anonymous 2012-01-01 9:02

>>27
/PROG/ QUALITY PROGRAMMING MEDAL

Name: Anonymous 2012-01-01 9:08

>>27
Actually, more like #include </dev/stdin>

Name: Anonymous 2012-01-01 9:14

#include </dev/zero>

Name: VIPPER 2012-01-01 9:32

/dev/, where /prog/ keeps all its headers.

Name: Anonymous 2012-01-01 9:34

>>31
My headers are implemented in hardware.

Name: Anonymous 2012-01-01 9:44


$ sudo dd if=code.h of=/dev/disk1s1
$ cat > hello.c

#include </dev/disk1s1>

int main() { someRandomFunc(); return 0; }

$ sudo gcc hello.c

Oh god my sides

Name: Anonymous 2012-01-01 9:58

>>31
I am a developer after all.

Name: Anonymous 2012-01-01 14:36

>>33
proggles.h:78345973489578934577357845345:58: error: stray ````>>33-san is a faggot'''' in program

Terminate? [y/n]

Y

Name: Anonymous 2012-01-01 14:45

Ocaml has camlp4. But it's horrible. It seems that author was molested as a child and now expresses the trauma in by code.

Have you seen paintings done by epileptical schizophrenics? camlp4 reminds me them.

Name: Anonymous 2012-01-01 15:04

>>36
10/10

Name: Anonymous 2012-01-01 17:36

M4 is the standard preprocessor of the GNU project and oh jesus fuck

Name: Anonymous 2012-01-01 17:52

>>36
"You want macros? Okay, first write a lexer..."

Name: Anonymous 2012-01-01 18:09

>>36
13/10

I laughed my ENTERPRISE-QUALITY LISP MACROS out.

Name: Anonymous 2012-01-01 19:12

(/ (+ 1 13) 10)

Name: Anonymous 2012-01-01 19:40

Name: Anonymous 2012-01-01 19:43

>>42
One more reason to hate it.

Name: Anonymous 2012-01-01 19:46

>>41
u mena ( /. ) (( +. ) 1. 13.) 10.

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