5/18 In how many languages can you say "stick your head in a pig"?
Collect them all here and we shall rival the x = 3 list...
UNIX csh: head $user >> /dev/pig
60a OOP Scheme: (ask you 'insert-head pig)
C: insert(Listtype pig, Listelement yourhead);
^
[This totally misses the point. It's not OO
or nearly as abstract as ~xxxxxxxx/pig.c]
is better than
ask2(you, stick, "head", pig);
/* really the same as...
you->stick(you, "head", pig);
^
[NOT. Try actually evaluating that.]
See ~xxxxxxxx/pig.c for details..... */
^
Ever hear of varargs, Dan? I thought not.
These still pale compared to the old vanilla:
(*(you->insert))(head, pig)
C++: you->insert(head, pig); /* note the simpler notation */
^
Note your mom...
\_ note my grandmother
perl: $pig = $body{head} <--- BZZT! Wrong. Try...
$body_part_location{$you, "head"} = $pig;
FMPL: ask(~pig, be_stuck(ask(.#self, head)))
FMPL-SFG: pig's be_stuck(.self's head)
fcl: if pig is somewhat available
then locality(you.head, pig) is very high.
forth: pig you head @ !
CL: (setf (location (you head)) pig)
PostScript: /stick-in-pig {/pig exch def} def
/head stick-in-pig
TCL: proc stickit {head} {
set ${pig} [list ${pig} ${head}]
return ${pig}
}
TCL#2: proc stickit head {
uplevel #0 "lappend pig $head"
}
OOScheme: (define head
(let ((contents nil))
(lambda (m . arg)
(cond ((eq? m 'stick)
(set! contents (car arg)))
(else (set! contents nil))))))
(head 'stick pig)
Scheme: (define (stick pig head)
(call-with-current-continuation
(lambda (c)
(c (cons head pig)))))
Kodiak: (a pig p1
(contents (a head h1)))
Prolog: stick(H,P) :- in(H,P), !.
FX90: (define-datatype container
(pigholder->container object))
(define-datatype holden
(pair->holden container object))
(match (pigholder->container pig)
((pigholder->container~ c) (pair->holden
(pigholder->container c)
(head->object #u))))
680x0: move #PIG,D0
swap D0
move #HEAD,D0
swap D0
move.L D0,A7
Z80: LD DE,#PIG
LD HL,#HEAD
LD BC,#$FFFF
DJNZ
Cluless: head:= [head insert pig];
UnterMud: actor.$head = pig.$body
Basica: <deleted>
Postquel: retrieve into pig (person.head)
where person.name = "xxxxxxxx"
AWK: awk '{ pig += $person.head } END { print pig }'
STRIPS:
(defun new-world()
(clear-db 'db)
(make-world '((is-receptacle pig) (is-body-part head)
(at nowhere-special1 you) (at nowhere-special2 pig))))
(setf *ops* (list (make-op
:name '(goto ?obj)
:pre '((at ?loc you) (at ?loc ?obj))
:add '((at ?obj you))
:del '((at ?loc you)))
(make-op :name '(stick ?body-part ?obj)
:pre '((at ?obj you)
(is-receptacle ?obj)
(is-body-part ?body-part))
:add '((is-inside ?obj ?body-part))
:del '((have ?obj)))))
(Mail blojo if you want a transcript of this code actually working.)
OO91: "Compiler error. Compilation aborted."
Object Oriented Cobol: [solution deleted by author in the intrest
of good taste]
Object C:
((CPigPane*)gGopher)->AddDirector((CHeadPanorama*)gHead->itsPane);
\
\
Isn't this getting a bit long?
^
You obviously haven't seen x=3.
Fortran: STICK('Head', 'Pig', 'You')
You have new mail. |