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

Pages: 1-4041-

Macgyver :D

Name: Anonymous 2009-10-14 0:22

i just wanna be like him
:)

Name: Anonymous 2009-10-14 2:40

The Sussman :D
i just wanna be like him
:)

Name: Anonymous 2009-10-14 3:47

Hitler :D
i just wanna be like him
:)

Name: Anonymous 2009-10-14 3:48

H̷̶̷̢̠̯̹̳͉͖̲̥̤͙̲̦̣̼̠̙̭̰̆ͣ̄̊̓͒ͧ̂ͮ͌ͬ͂͒̽̀̆̀ȩ̴̢̹̥͖̭̹̪̯̥̦ͦ͊̎̊͘͢ ̴̈̔ͮ̆̽ͩ̉̈҉̵̢̰̳͕̰̮͔̻̰͞c̸̵̗̭͇̰̲̠̗͉̞͋̊̌̓̓̾͡o̷̢̢̘͍̹̥̮͇͓̯͈̝̲̬͈͓̠̩̾ͥ̆m̵̍͆ͩͬ͗̄̃͐҉̷̢̗̙͚̭̥͈̗̭̱̣̞̰̟̳̘̜ĕ̄̏͌̀̚̚͘҉̬̖̤͉̤͙̦̙̞̮̯͔̼̩͕s̯̫̩̫̱̳͛ͬͭ̾ͦ̏̿̅̈̈̇ͪ͛͋ͤͫ̆ͤ͝
̶̷̧̭̮̫̜̈́ͩͪ̋ͪͫ̐̽͠S͔͖͔̜̝͇̞̤̮̗͍̪̝̞̹̩͕̭̳̋͂̐̊̍͛͐́͛̄ͤ̚̕͟Ů̞̣̤̮͇͈̱̪͇̼͇̦͔͓̂̿͐ͤ͐̇̒̌̂̈́̆̕S̴̷̶̨͉̠̰̼̤̬͎͙̞͗͌̈̓̋ͦS̨̳̹̬͖̲̞̜̥̗͚̖̺̬̞͍̘̝̈̏͒̅̽̑ͤ̄̆͋̄͗ͯͫ̈́̏̌̅́͡M̶̨͎̭̟̠͔̙͙̞̭̹̘̱̫̽̇ͯ͛ͣͥͯ͋̋̅̄̚͘A̵̶͌̓́̓̏̐͂͂̄̉͛̏ͨ͝͏̹̞͓̝͎̺N̫̜͙̩̗͑̐ͮ̓̾̃̾́͠!̸̶͎͖̪̣̖̦͕̻͖͎̪̪̮̘̠̮͈̼ͯͬ̀̎͒̑̽̃͋͜
ͫͤͦ͑ͫ̈́̃́ͦͦͫ́͏̨̢̩̥̘̯̗̬̞͓̯̞̪̱͖̺͖͇͚

Name: Anonymous 2009-10-14 4:35

>>4
It's so beautiful ಥ_ಥ

Name: Anonymous 2009-10-14 8:51

`(,display ,@((call/cc (lambda (c) c)) 3))

Name: Anonymous 2009-10-14 8:52

>>6
In what language do you think you are writing?

Name: Anonymous 2009-10-14 9:45

Name: Anonymous 2009-10-14 15:41

>>7
Liskell

Name: Anonymous 2009-10-14 16:14

>>9
Hasp is superior

Name: Anonymous 2009-10-14 16:21

JAVASCRIPT IS THE RULER OF ALL SCRIPTING LANGUAGES!

Name: Anonymous 2009-10-14 16:26

>>11
U MENA PERL
I understand your confusion, grasshopper, but all will become clear as you travel the Path.

Name: Anonymous 2009-10-14 16:55

>>12
Javascript may be to Lisp as PHP is to Perl, but Perl is to programming languages as wood chippers are to vaginas.

Name: Anonymous 2009-10-14 17:01

>>13
You obviously do not know the pleasure of being Perled inside.
Perl is made of pure awesomeness.

Name: Anonymous 2009-10-14 17:12

>>14
Go home, Larry. Perl is a horrific mess, mostly because it tries to emulate natural language, which any idiot could tell you is a horrible idea in a programming language not aimed at young girls.

Name: Anonymous 2009-10-14 17:13

>>15
You obviously do not know the pleasure of being Perled inside.
Perl is made of pure awesomeness.

Name: Anonymous 2009-10-14 17:13

Lisp + Haskell = MAGIC

Name: TRUE TRUTH EXPERT !!TthtFzrtPXElUy7 2009-10-14 17:14

Perl is cool, but you won't convince me to use it instead of lisp.

Name: Anonymous 2009-10-14 17:51

>>18
Using proper capitalization like a real Anonymous
OH MY GODDDDDDDDDD

Name: Anonymous 2009-10-14 18:01

>>19
>oH MY GODDDDDDDDDD
ftfy

Name: Anonymous 2009-10-14 18:29

>>17
Did you mean, "Lisp + Haskell = MAGIC"?

Name: Anonymous 2009-10-14 18:36

>>21

Spell has to do with magic. I don't even know what a Likell is.

Name: Anonymous 2009-10-15 4:12

>>4
You ruined this thread.

Name: Anonymous 2009-10-15 6:43

>>18
write a lisp interpreter in perl .

Name: Anonymous 2009-10-15 6:53

>>24
write a perl interpreter in lisp

Name: Anonymous 2009-10-15 7:22

>>25
write a lambda calculus interpreter in prolog

Name: Anonymous 2009-10-15 9:25

>>26
write a prolog interpreter in lambda calculus

expecting a full parser/lexer/tokenizer in half an hour, 'kay

Name: Anonymous 2009-10-15 16:47

>>27
except lambda calculus does not deal with state, so you're exercise is impossible to accompish

Name: Anonymous 2009-10-15 16:53

>>28
You better be trolling, if it can't be done in lambda calculus it can't be done with any programming language.

Name: Anonymous 2009-10-15 16:55

>>28
DO THE IMPOSSIBLE
SEE THE INVISIBLE
BREAK THE UNBREAKABLE
ROW ROW FIGHT DA POWAH

Name: Anonymous 2009-10-15 16:58

>>29
YHBT

Name: Anonymous 2009-10-15 18:54

>>29
Parsing is all about keeping state. Lambda expressions don't hold state. What's so hard to understand?

Name: Anonymous 2009-10-15 19:03

>>32
Has never parsed a list in a functional manner

Name: Anonymous 2009-10-15 19:07

>>29
can lambda calculus use gotos?

Name: Anonymous 2009-10-15 19:09

>>34
Doesn't need them ;)

Name: Anonymous 2009-10-15 19:55

>>35
Then it can't solve complex problems that require them.

Name: Anonymous 2009-10-15 19:59

>>36
Here's an exercise. Write a memory manager in lambda calculus. Oh that's right, you can't because you can't do shit in lambda calculus. How do you like that?

Name: Anonymous 2009-10-15 20:34

>>36
What problems are these? I'm sure the vast majority of goto uses can be worked around even if hackishly.

>>37
Since Scheme can basically be reduced down to the lambda calculus, and I can write a memory manager in Scheme. I refute your point.

Name: Anonymous 2009-10-15 20:50

>>37
Lambda calculus is touring complete, anything computable can be computed using lambda calculus.

Name: Anonymous 2009-10-15 21:19

>>38,39
This is what Lisp users actually believe.

Name: Anonymous 2009-10-15 21:22

>>39
The right answer is that lambda calculus could be used to emulate the behaviour of a memory manager. It can't be used to make a real memory manager as it's just a formal mathemathical system which has nothing to do with how hardware works. That said, you might be able to implement one if you defined a concrete language based on it and give it an FFI, or just access to primitive memory management functions, but that will no longer be lambda calculus, but a practical language based on it.

Name: >>41 2009-10-15 21:23

>>40
I'm a Lisper, and you can read my opinion in >>41.

Name: Anonymous 2009-10-15 22:55

>>43
I'm a >>41, and you can read my opinion in LISP

Name: Anonymous 2009-10-15 23:28

>>44
I'm a troll, and you have been trolled consistently.

Name: Anonymous 2009-10-15 23:39

>>44
トロールにトロールをトロールング。

Name: Anonymous 2009-10-16 5:51

>>40
Looks like someone went to a JavaSchool and thinks he can't write Generic Sort Algorithm #39 in functional languages.

Name: Anonymous 2009-10-16 15:35

>>46
Well..... You can't.

Name: Anonymous 2009-10-16 16:06

>>47
Shows wat you know.

(define bubble_sort
   X -> (bubble_again_perhaps (bubble X) X))

(define bubble
  [] -> []
  [X] -> [X]
  [X Y | Z] -> [Y | (bubble [X | Z])]   where    (> Y X)
  [X Y | Z] -> [X | (bubble [Y | Z])])

(define bubble_again_perhaps
   X X -> X
   X _ -> (bubble_sort X))

Name: Anonymous 2009-10-16 16:09

>>48
Far from elegant

Name: Anonymous 2009-10-16 16:16

>>48
It's like you took the worst part of Haskell syntax and LISP syntax, and mashed them together. And added toenail clippings.

Name: Anonymous 2009-10-16 16:19

>>50
Only that lisp doesn't have a worse part to have a worst part.

Name: Haxus the Liskellite 2009-10-16 16:34

>>50
U MENA LISKELL

Name: Anonymous 2009-10-16 16:50

>>48
Oh god, is that... Qi?!

Name: UMH memesmith !gNlkr4vCuc 2009-10-16 16:53

>>52
...shut up...

Name: Anonymous 2009-10-16 16:55

>>53
Qi
*fap fap fap*

Name: Anonymous 2009-10-16 17:00

>>53
Damn straight it is. I mostly like this example for its bubble_again_perhaps function.

Name: Anonymous 2009-10-16 18:35

>>56
Now write a dual-pivot quicksort in your precious functional language, without using any imperative features (loops, selection, state, etc...). Ensure that it is stable (equal keys appear in order).

Name: Anonymous 2009-10-16 18:39

i demand a functional implementation of a binary tree sort!

Name: Anonymous 2009-10-16 19:23

What's the point in demanding functional implementations?
You can emulate state generally(not talking just about tail-recursion + TCO here!) in a functional manner, even if without a very smart compiler it would be terribly inefficient when compiled. Of course, a purely functional implementation that just did the right thing instead of emulating state would be much more proper and faster.

Name: Anonymous 2009-10-16 19:43

>>57
I'm too lazy to write the stable version, would you accept a 3 minute nonstable version?

Name: Anonymous 2009-10-16 19:46

>>60
Here's the non-stable version by the way. It could use a refactoring and I guess I'll do that when I write the stable verson.

(define (split num l)
  (let iter ((original l) (lt '()) (gt '()))
    (cond ((null? original)
           (list (reverse lt) (reverse gt)))
          ((< (car original) num)
           (iter (cdr original) (cons (car original) lt) gt))
          (else
           (iter (cdr original) lt (cons (car original) gt))))))

(define (qs l)
  (cond ((null? l) l)
        ((null? (cdr l)) l)
        (else
         (let* ((pivot-a (car l))
                (pivot-b (cadr l))
                (rest (cddr l))
                (first (min pivot-a pivot-b))
                (second (max pivot-a pivot-b))
                (split-at-first (split first rest))
                (start (car split-at-first))
                (split-at-second (split second (cadr split-at-first)))
                (middle (car split-at-second))
                (end (cadr split-at-second)))
           (append (qs start) (list first) (qs middle) (list second) (qs end))))))

Name: Anonymous 2009-10-16 19:51

>>59-61
My point is functional languages will never be elegant or "better" in almost every real-world situation. Don't get me wrong, it's pretty neat being able to define factorial using pattern matching, but it really doesn't belong in mainstream programming.

Name: Anonymous 2009-10-16 19:54

Here's someone else's implementation in Common Lisp:

(defun quicksort (lst)
  (when lst
    (let ((pivot (car lst)))
      (append
       (quicksort (remove-if-not (lambda (x) (<= x pivot)) (cdr lst)))
       (list pivot)
       (quicksort (remove-if-not (lambda (x) (>  x pivot)) (cdr lst)))))))

Name: Anonymous 2009-10-16 19:55

>>62
Surely that's just being rather pedantic, It doesn't have to be better in almost every real-world situation. I'm from the SICP school of thought and I use the best form of modelling for the problem at hand. If it's expressed more clearly/efficiently with state, then I'll use state, but in many cases a functional approach is best.

Name: Anonymous 2009-10-16 19:55

>>63
It's not dual pivot ;)

Name: Anonymous 2009-10-16 19:56

>>62
I don't know about purely functional languages, but some more pragmatic ones make a lot of things much easier, but I don't care about what other people use(mainstream programming), as long as there's enough community to keep developing libraries and implementations for the language of my choice, in this case, Common Lisp.

Name: Anonymous 2009-10-16 20:06

>>62
Yaroslavskiy's Java implementation is three pages long. So there's one metric functional languages are “better” by.

Name: Anonymous 2009-10-16 20:09

>>67
How much of that is optimisations? Or is it just a vanilla dual-pivot quicksort? I know Java is verbose, but really?

Name: Anonymous 2009-10-16 20:16

>>68
A fair bit. Plus there's the colossal number of newlines (hurr, brace on its own line).

Name: Anonymous 2009-10-16 20:44

>>61
The stable version isn't substantially longer, but is UGLY AS FUCK™!. If anyone cares, I'll post after a refactor.

Name: Anonymous 2009-10-16 21:33

partition is stable, so:

import List

quicksort (p1': p2': l) =
   quicksort ltp1 ++ p1: quicksort gep1_lep2 ++ p2: quicksort gtp2
   where
      (p1, p2) = if p1' > p2' then (p2', p1') else (p1', p2')
      (ltp1,      gep1) = partition (< p1) l
      (gep1_lep2, gtp2) = partition (<=p2) gep1

quicksort l = l

Name: Anonymous 2009-10-16 21:36

>>71
Wait. Nevermind, that's unstable. Oh, well.

Name: Anonymous 2009-10-16 21:47

Now it's stable:

import List

quicksort (p1': p2': l)
   | p1 == p2  = quicksort ltp1 ++ p1: p2: quicksort gep1_lep2 ++ quicksort gtp2
   | otherwise = quicksort ltp1 ++ p1: quicksort gep1_lep2 ++ p2: quicksort gtp2
   where
      (p1, p2) = if p1' > p2' then (p2', p1') else (p1', p2')
      (ltp1,      gep1) = partition (< p1) l
      (gep1_lep2, gtp2) = partition (<=p2) gep1

quicksort l = l

Name: Haxus the Liskellite 2009-10-17 6:25

U MENA LISKELL

Name: Anonymous 2011-02-03 4:45

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