;; (*.) = {- *) let (@@) x y = x::y let e = [] let a = (* (letrec ((a '( ; -} -- *) " " @@ " A polyglot quine in " @@ " Haskell & O'Caml & Scheme " @@ " Author: Unknown " @@ " " @@ " Usage: runhugs thisfile # www.haskell.org/hugs " @@ " ocamlc -o x thisfile.ml ;./x # www.ocaml.org " @@ " scsh -s thisfile # www.scsh.net " @@ " " @@ "" @@ ";; (*.) = {- *) let (@@) x y = x::y let e = [] let a = (*" @@ "(letrec ((a '(" @@ "; -} -- *)" @@ "" @@ " e" @@ ";; (*:) = [\" \" ++ show x ++ \" @@\" | x<-( *.)]; main = {-" @@ "; -} sequence_ (map putStrLn (x ++ ( *:) ++ y)); (x, _:y) = {-" @@ "; -} span p (tail (dropWhile p ( *.))); p = (/= \"\"); infixr {-" @@ "; -} @@; (@@) = (:); e = [] {- *) let rec s = function [] -> (*" @@ "; *) [],[] | x::y -> if x = \"\" then [],y else let a,b = s y (*" @@ "; *) in x::a,b let b,d = s (snd (s a)) let f = String.escaped (*" @@ "; *) let c = List.map (fun x -> \" \\\"\" ^ f x ^ \"\\\" @@\") a" @@ ";; List.iter (fun x -> print_endline x) (b @ c @ d) (*" @@ ")) (f (lambda (x) (if (null? x) x (if (string? (car x)) (cons (" @@ "car x) (f (cdr x))) (f (cdr x)))))) (g (lambda (x) (if (string=?" @@ "\"\" (car x)) (cons '() (cdr x)) (let ((y (g (cdr x)))) (cons (" @@ "cons (car x) (car y)) (cdr y)))))) (h (lambda (x) (if (null? x)" @@ "#f (begin (display (car x)) (newline) (h (cdr x)))))) (i (lambda" @@ "(x) (if (null? x) #f (begin (display \" \") (write (car x)) (" @@ "display \" @@\") (newline) (i (cdr x))))))) (let ((b (g (cdr (g" @@ "(f a)))))) (h (car b)) (i (f a)) (h (cdr b))))" @@ "; -} -- *)" @@ e ;; (*:) = [" " ++ show x ++ " @@" | x<-( *.)]; main = {- ; -} sequence_ (map putStrLn (x ++ ( *:) ++ y)); (x, _:y) = {- ; -} span p (tail (dropWhile p ( *.))); p = (/= ""); infixr {- ; -} @@; (@@) = (:); e = [] {- *) let rec s = function [] -> (* ; *) [],[] | x::y -> if x = "" then [],y else let a,b = s y (* ; *) in x::a,b let b,d = s (snd (s a)) let f = String.escaped (* ; *) let c = List.map (fun x -> " \"" ^ f x ^ "\" @@") a ;; List.iter (fun x -> print_endline x) (b @ c @ d) (* )) (f (lambda (x) (if (null? x) x (if (string? (car x)) (cons ( car x) (f (cdr x))) (f (cdr x)))))) (g (lambda (x) (if (string=? "" (car x)) (cons '() (cdr x)) (let ((y (g (cdr x)))) (cons ( cons (car x) (car y)) (cdr y)))))) (h (lambda (x) (if (null? x) #f (begin (display (car x)) (newline) (h (cdr x)))))) (i (lambda (x) (if (null? x) #f (begin (display " ") (write (car x)) ( display " @@") (newline) (i (cdr x))))))) (let ((b (g (cdr (g (f a)))))) (h (car b)) (i (f a)) (h (cdr b)))) ; -} -- *)