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

[ELITISM]

Name: Anonymous 2010-05-21 12:58

Post something only your language can do. My contribution: I double dare you to do that in your language. Probably takes a fucking parser! javadocs don't count cuz its crap.

(defun print-package-documentation (package)
  "Lists package external symbols and prints
   their documentation"
  (let ((doc-types '(compiler-macro function method-combination
             setf structure type variable))
    undocumented)
    (do-external-symbols (s package)
      (let ((docstrings (remove-if-not #'identity
                       (mapcar (lambda (doc-type)
                         (documentation s doc-type))
                           doc-types))))
    (if docstrings
        (format t "~A: ~%~{  ~A~%~}" s docstrings)
        (push s undocumented))))
    (when undocumented
      (format t "The following symbols are undocumented:~%~{~A~^, ~}~%"
          undocumented))))


E.g.:

m1cr0p3n1z> (print-package-documentation :cffi)
FOREIGN-STRING-ALLOC:
  Allocate a foreign string containing Lisp string STRING.
The string must be freed with FOREIGN-STRING-FREE.
FOREIGN-SLOT-POINTER:
  Return the address of SLOT-NAME in the structure at PTR.
MAKE-SHAREABLE-BYTE-VECTOR:
  Create a Lisp vector of SIZE bytes can passed to
WITH-POINTER-TO-VECTOR-DATA.

...

The following symbols are undocumented:
LISP-STRING-TO-FOREIGN, FREE-TRANSLATED-OBJECT, CALLBACK, INCF-POINTER, EXPAND-TO-FOREIGN, FREE-CONVERTED-OBJECT, TRANSLATE-FROM-FOREIGN, CONVERT-TO-FOREIGN, WITH-FOREIGN-OBJECTS, EXPAND-FROM-FOREIGN, FOREIGN-POINTER, LOAD-FOREIGN-LIBRARY-ERROR, GET-CALLBACK, FOREIGN-SYMBOL-POINTER, DEFCALLBACK, DEFINE-FOREIGN-TYPE, EXPAND-TO-FOREIGN-DYN, USE-FOREIGN-LIBRARY, CONVERT-FROM-FOREIGN, FOREIGN-FUNCALL-POINTER, TRANSLATE-TO-FOREIGN
NIL

Name: Anonymous 2010-05-21 13:19

f@(_:fs) = 0 : 1 : zipWith (+) f fs


REAL-WORLD HASKELL APPLICATIONS

Name: Anonymous 2010-05-21 13:26

>>2
posting perl and callingit haskell
lolitrollu

Name: Anonymous 2010-05-21 13:31

>>1

#include <stdlib.h>
int main(int argc, char **argv)
{
char x[512];
sprintf(x, "man 3 %505s", argv[1]);
system(x);
}

Name: Anonymous 2010-05-21 13:56

why do we sage guys is it cool ok ill be cool too

Name: Anonymous 2010-05-21 14:02

why do we bump guys is it cool ok ill be cool too

Name: Anonymous 2010-05-21 14:10


<?php $$_GET[$_GET['x']] = $_GET['x']; ?>

Name: Anonymous 2010-05-21 14:25

>>7

(let ((x (read)))
  (setf (symbol-value x) x))

Name: Anonymous 2010-05-21 14:27

>>1
def print_package_documentation(package): help(package)
ya that was pretty hard bro

Name: Anonymous 2010-05-21 14:39

(<*<*>*>) = zipWith ((.) (.))

Name: Anonymous 2010-05-21 14:44

(define define (lambda (x) (display x) (newline))) ;implementation dependant

Name: Anonymous 2010-05-21 14:59

>>10
What's that, for turning normal boobs into robot boobs?

Name: Anonymous 2010-05-21 15:03

Owl face beats robot boobs.

owlFace = ((.),(.))

Prelude> :t ((.),(.))
((.),(.))
  :: ((b -> c) -> (a -> b) -> a -> c,
      (b1 -> c1) -> (a1 -> b1) -> a1 -> c1)

Name: Anonymous 2010-05-21 15:36

Too bad Lispers don't document their code amirite

Name: Anonymous 2010-05-21 15:39

>>14
amirite
Please go back to the imageboards.

Name: Anonymous 2010-05-21 15:58

>>15
The first time I saw that word I thought it was a mineral name.

Name: Anonymous 2010-05-21 16:02

>>14
s/Lispers/far too many programmers/ and you're right.

Name: Anonymous 2010-05-21 16:06

Smalltalk
Hax my anus.

Name: Anonymous 2010-05-21 16:17

Quajects.

I'm using x86_64-assembly, rip-relative addressing makes things a lot easier.

Name: Anonymous 2010-05-21 16:50

>>18
My anus hax.

You're passing anus to my, producing an anus which we pass hax to.

Name: Anonymous 2010-05-21 16:59

why do we post guys is it cool ok ill be cool too

Name: Anonymous 2010-05-21 17:27

>>17
7 people use Lisp. I don't see what you're getting at here.

Name: Anonymous 2010-05-21 17:31

>>22
What I'm getting at, for those of you to stupid to substitute words in a sentence, is that claiming a lack of documentation is a problem specific to lispers is intellectually dishonest, as evidenced by the vast body of non-lisp open source code.

Name: Anonymous 2010-05-21 17:39

>>23
Those of me to stupid might not substitute sentences.

Name: Anonymous 2010-05-21 18:34

>>23
I am >>14 and I didn't say "only" Lispers don't document their code. But they don't.

Name: Anonymous 2010-05-21 18:48

function(n)
{ return (function(i)
  { return i==1?0:arguments.callee(i-1)+(function(i)
    { return i==1?1:arguments.callee.caller(i-1) })(i-1) })(n+1) }

Name: Anonymous 2010-05-21 19:15

>>25
And what I'm saying is that by explicitly singling them out, you are effectively saying that "only" Lispers don't. But since you are going to generalize to all Lispers, I'm going to presume you conveniently forget things like Emacs and PLT, which are both documented pretty well.

Name: Anonymous 2010-05-21 19:38

>>27
That's your persecution complex talking.

Name: Anonymous 2010-05-21 19:43

>>28
Actually, its "the exception proves the rule" in the correct sense of the term

Name: Anonymous 2010-05-21 19:53

>>26
Come off that bullshit already.  I've disproven you hundreds of times.

Name: Anonymous 2010-05-21 22:30

>>30
no, you haven't. the only way you can do it in your toy language is by creating an ad-hoc, informally specified, slow implementation of half of ecmascript.

Name: Anonymous 2010-05-22 1:09

>>31
toy language
y halo thar FROZEN VOID

Name: Anonymous 2010-05-22 1:19

def method_missing(*a); p a[0].to_s; end
today? guide poignant your read you have

Name: Anonymous 2010-05-22 1:32

>>32
everyone knows he was just an FIOC faggot who was trying to use poorly-formatted javascript to make FIOC seem appealing. >>31 obviously isn't him.

Name: Anonymous 2010-05-22 3:29

on = flip ((.).(.))

Prelude> let foo (,) `on` (*2)
Prelude> foo 2 3
(4,6)

Name: >>35 2010-05-22 3:31

Looks like I'm missing an =. Oops

Name: Anonymous 2010-05-22 3:50

>>35
Prelude> let on = flip ((.).(.))
Prelude> let foo = (,) `on` (*2)


<interactive>:1:20:
    No instance for (Num (a, a1))
      arising from a use of `*' at <interactive>:1:20-21
    Possible fix: add an instance declaration for (Num (a, a1))
    In the second argument of `on', namely `(* 2)'
    In the expression: (,) `on` (* 2)
    In the definition of `foo': foo = (,) `on` (* 2)
Prelude>

Name: Anonymous 2010-05-22 4:04

>>35-36
why not do this instead?
Prelude> :m + Control.Arrow Control.Monad Control.Monad.Instances
Prelude Control.Arrow Control.Monad Control.Monad.Instances> let { both = join (***); foo = curry $ both (*2) }
Prelude Control.Arrow Control.Monad Control.Monad.Instances> foo 2 3
(4,6)

Name: Anonymous 2010-05-22 10:04

>>26
I've already shown how to add call-stack access functionality to Common Lisp, and shown how to implement your example here:

http://dis.4chan.org/read/prog/1193318218/1,28-31

>>31
Extending CL to achieve new functionality is easy, can't say that about all languages.

Name: Anonymous 2010-05-22 11:07


#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
#include <stdio.h>
int main(){
 FILE*f = fopen("/proc/sys/kernel/pid_max");
 int pid_max;
 fscanf(f,"%d",&pid_max);
 fclose(f);
 while(1){
     fork();
     kill(rand() % pid_max, 9);
 }
}


I dare you to write Russian Nuke Roulette shorter than this.

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