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

eerui

Name: Anonymous 2010-09-16 22:38

ITT:
We write different ways to produce 'hello world' in the shell
language : c++
no syntax errors, and no copying others work. I'll start with something simple

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

Name: Anonymous 2010-09-16 23:08

#lang racket
(define-syntax c++-display
  (syntax-rules ()
    ((_ s) (string-append "std::cout << "
                          s
                          " << std::endl;"))))

(define-syntax main
  (syntax-rules ()
    ((_ exps ...)
     (string-append "#include <iostream>\n"
                     "int main () {\n"
                     (string-append*
                      (map (λ(s)
                             (string-append "\t" s "\n"))
                           (list exps ...)))
                     "\treturn 0;\n\t}\n"))))

(display
   (main
    (c++-display "Hello world!")))

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