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

ROAD TO PROGRAMMING EXPERTISE

Name: Anonymous 2010-02-20 8:39

Do I need to learn functional programming and LISP ()())())))))))))))))))))))) to be an EXPERT DEVELOPER ?

Name: Anonymous 2010-02-20 8:40

No.
______
If you believe in Jesus Christ and are 100% proud of it put this as your signature.

Name: Anonymous 2010-02-20 8:54

No.

______
If you believe in Anus Haxing and are 100% proud of it put this as your signature.

Name: Anonymous 2010-02-20 8:55

What did the sound artist's wife say to him in bed?

FLACS MY ANUS

Name: Anonymous 2010-02-20 9:07

Yes.

Name: Anonymous 2010-02-20 9:11

What did the raincoat salesman's wife say to him in bed?

MACS MY ANUS

Name: Anonymous 2010-02-20 9:12

No.

______
If you believe in disembowling this faggot >>3  and are 100% proud of it put this as your signature.

Name: Anonymous 2010-02-20 9:13

HMA FOREVAR

Name: Anonymous 2010-02-20 10:06

What did the game theorists's wife say to him in bed?

MINIMAX MY ANUS

Name: Anonymous 2010-02-20 10:25

>>1
If you can't even balance some parentheses you already fail. Go back to flipping burgers, kid.

Name: Anonymous 2010-02-20 10:26

No, only if you want to achieve Satori.

______
If you believe in disembowling this faggot >>3  and are 100% proud of it put this as your signature.

Name: Anonymous 2010-02-20 22:18

>>11
disembowling this faggot >>3
You plan to circumvent the anus entirely?  Is that allowed?

Name: Anonymous 2010-02-21 9:44

Hax is a slang term which is derived from the word "hack" and it is commonly used in online games such as Ragnarok Online and Counter Strike,etc. This term means breaking the rules by using programs to alter the skills of a player in a video game, but it can also be used to compliment someone. For example, when people say this to you: "2k werdz in da too minetz? dats HAX!?", they mean that you type extremely fast. This term can also be used in many forms such as verb, adjective, adverb, and noun. there are lots of hax for example speed hax, lag hax, flying hax, aimbot, color aimbot and stoogebot

Name: Anonymous 2010-02-21 9:45

The above is actual wikipedia article.

Name: Anonymous 2010-02-21 12:40


\Huge
YOUR A FAGGOT
YOU JUST \emph{FUQING} ANGERED A \raisebox{0.2em}{EXPERT PROGAMER}

Name: Anonymous 2010-02-21 12:40

>>15
The moral of the story is that someone should build a BBS over LaTeX.

Name: Anonymous 2010-02-21 12:42

>EXPERT PROGAMER
I lol'd

Name: Anonymous 2010-02-21 12:51

>EXPERT PROGAMER
I lol'd.

Name: Anonymous 2010-02-21 12:54

>>15

\fbox{EXPERT PROGAMER}

I lol'd

Name: Anonymous 2010-02-21 13:13

progs jealous it doesnt have latex

Name: Anonymous 2010-02-21 13:28

>>20's jealous he doesn't have punctuation.

Name: Anonymous 2010-02-21 13:37

>>21
nope

Name: Anonymous 2010-02-21 13:41

Someone with a knowledge of Lisp and macros and whatnot, make a program that defines Sunn O as equivalent to three open parens, so that you can make Sunn O))) a valid lisp statement.

You can do that, right?

Name: Anonymous 2010-02-21 13:48

>>23
Doable with reader macros(which are just installable hooks into the reader, they have nothing to do with macros which are code transformations), or just using a custom reader, but why would anyone sane do that? It would break most paren balancing editors and won't provide any practical benefit.

Name: >>24 2010-02-21 13:53

Did I also mention that three open parens usually have no purpose/are invalid, unless quoted in CL? If you really want to do it, just look into READ,SET-DISPATCH-MACRO-CHARACTER,SET-MACRO-CHARACTER, but it would really serve no practical purpose to do so.

Name: Anonymous 2010-02-21 14:24

>>25
perhaps you should make Sunn a reader macro for three open parens, and O a function (that returns a function that returns a function)

Name: Anonymous 2010-02-21 14:35

>>26
Wouldn't work unquoted without a custom EVAL, since CL is a Lisp-2/n (you can't have lists other than lambdas in the CAR of a form). It would work in Scheme since it's a Lisp-1, but I don't know if Scheme has any portable reader extension functions - maybe there is one in the SRFI's, but I'll wait for someone who actually writes more Scheme than me to answer. Albeit, if you use a Lisp-1 EVAL (and there's quite a few, actually, a better solution would be to just do a code transform from Lisp-2 to Lisp-1 - there's even some libraries for this), it would work.

Name: >>27 2010-02-21 14:37

Of course, if you're making a nonsensical reader macro like this, you could just make it eat those 3 parens and return a value of your own, but it wouldn't be reading/"expanding" to those 3 parens you're expecting.

Name: 26 2010-02-21 16:26

Unfortunately we don't have a portable reader syntax (are you surprised?), and not even all Schemes have a modifiable reader. PLT does, and has some kind of readtables (see below). Ikarus, as far as I can tell, doesn't allow you to modify the reader. It does have two syntax modes, #!ikarus and #!r6rs, one of which has a few additional niceties, like graph syntax. I don't usually use other Schemes, so if you use a different implementation you'll have to do your own research ;)

Here is a bad first attempt at the "Sunn" reader macro which should be replaced with "(((". I can never remember how to use PLTs readtables, so this is just me working off the docs as best as I can. For portabilities sake, don't use PLT I'd probably write a parser and read a text file, but here goes...

(define sunn-reader
  (letrec ((current (current-readtable))
           (sunn (case-lambda ((ch port) ;;required because read/syntax is different that read
                                (sunn ch port #f #f #f #f))
                               ((ch port src line col pos)
                                (parameterize ((current-readtable unn-reader))
                                  (read port)))))
           (unn-reader (make-readtable current
                                       #\u #\( current
                                       #\n #\( current)))
    (make-readtable current #\S 'non-terminating-macro sunn)))

;What I'm doing is just dropping the first S (which has to beat the start of a symbol) and reading the rest with new readtable where u and n count as open parentheses. Yes, that would be a bug, but fuck it, it's a toy example.

(parameterize ((current-readtable sunn-reader))
    (read (open-input-string "Sunn )))")))
((()))
;which is what we expected
(parameterize ((current-readtable sunn-reader))
    (read (open-input-string "Sunn i hate yor mothers white ass )))")))
(((i hate yor mothers white ass)))
;Again, correct output
(parameterize ((current-readtable sunn-reader))
    (read (open-input-string "Sunn i hate your mothers white ass )))")))
. read: expected a `)' to close `u'
;Can you see where the bug?
(parameterize ((current-readtable sunn-reader))
    (read (open-input-string "Sunn i hate your mothers white ass ))))")))
(((i hate yo (r mothers white ass))))
;There it is ;)
(parameterize ((current-readtable sunn-reader))
    (read (open-input-string "aSunn i hate your mothers white ass ))))")))
aSunn
; This is also correct
(parameterize ((current-readtable sunn-reader))
    (read (open-input-string "Sunn i hate your mothers white ass Sunn )))))))")))
(((i hate yo (r mothers white ass S ((()))))))
; Inner Sunns don't work, the readtable would need to be improved
(parameterize ((current-readtable sunn-reader)
                 (current-input-port (open-input-string "Sunn i hate your mothers white ass )))) unn)))")))
    (list (read) (read)))
((((i hate yo (r mothers white ass)))) unn)
; at least the inner readtables don't leak out


Obviously, this is a quick 5 minute hack, as you wouldn't want that buggy behaviour with an Enterprise Quality Sunn Macro. If anyone actually gives a toss, I could finish this off, but I'm not really fussed. Syntax-rules and syntax-case are fine for me 99% of the time and the other 1% I could just write a parser.

Name: Anonymous 2010-02-21 16:30

>>29
The docs can be found at http://docs.plt-scheme.org/reference/Reader_Extension.html and give a much more useful example, if anyone is interested.
You can also farm the reader out to a seperate module, and have a #reader declaration at the top of your program.

Also, I wish I'd remembered that I need to use additional BBcodes to get multiline quoting for the interpreter prompts.

Name: 27 2010-02-21 18:56

>>29
Since you posted code, I decided to write a solution in CL, which does not have the issues of your version, but it's still not ideal (does not account for future readtable changes - I could make it work, but would require more elaborate work, and it'd be much mor slower):

(defconstant +magic-keyword+ "Sunn O")
(defconstant +magic-keyword-char+ (aref +magic-keyword+ 0))
(defconstant +magic-keyword-rest+ (subseq +magic-keyword+ 1))
;; this is actually not perfect, but should be enough for this hack
(defvar *original-readtable*)

(defun read-string (stream length)
  (let ((string (make-string length)))
    (read-sequence string stream :end length)
    string))

(defun SunnO-reader (stream char)
  (assert (char= char +magic-keyword-char+)) 
  (let ((string (read-string stream (length +magic-keyword-rest+))))
    (let ((*readtable* *original-readtable*))
      (read           
       (make-concatenated-stream
        (make-string-input-stream
         (if (string= string +magic-keyword-rest+) "((("
             (concatenate 'string  (string +magic-keyword-char+) string)))
        stream)
       t nil t))))

(eval-when (:compile-toplevel :load-toplevel :execute) 
  (setq *original-readtable* (copy-readtable))
  (set-macro-character #\S #'SunnO-reader))

;CL-USER> 'Sunn O this is stupid and useless but at least it's a half-clever hack)))
;(((THIS IS STUPID AND USELESS BUT AT LEAST IT 'S A HALF-CLEVER HACK)))
;CL-USER> (STRING 'sup-/prog/)
;"SUP-/PROG/"
;^ shows that other strings starting with S are not affected

Name: Anonymous 2010-02-21 19:01

>>31
The issue for me was lack of familiarity (and laziness). I've written a reader macro exactly once before, and I couldn't remember jack. I could probably do it better, and hell I may as well. I've got nothing better to do.

Name: Anonymous 2012-12-08 15:54

( ͡° ͜ʖ ͡°)

Name: Anonymous 2012-12-08 17:33

>>34

( ͡° ͜ʖ ͡°)

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