[moon] home
IPv4

Erlkönig: pig-sticking.shtml

parent
[parent webpage]

server
[webserver base]

search
[search erlkonig webpages]

trust
[import certificates]


homes
[talisman]
[zoion]
From blojo@soda.berkeley.edu Wed May 20 00:34:12 1992
From: blojo@soda.berkeley.edu (Jon Blow)
Subject: Soda motd II
Date: 20 May 92 02:44:05 GMT
Newsgroups: alt.motd
Organization: Crimestoppers-A-Go-Go


                        Welcome to Soda

5/19    TOTAL Hosersness.
          3772  xxxxxx    (/usr3)        2663  xxxxxx
                \_find . -name \* -exec compress {} \;
          3750  xxxxxx    (/usr3)        2619  xxxx
          3105  xxxxxx    (/usr3)        2609  xxx
          2851  xxxxxxxx                 2589  xxxxx
          2680  xxxxx     (/usr3)        2505  xx

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: 
        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')

disencrypt lang [de jp fr] diff backlinks (sec) validate printable
Cogito ergo spud (I think therefore I yam).
[ Your browser's CSS support is broken. Upgrade! ]
alexsiodhe, christopher north-keys, christopher alex north-keys