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

If Lisp is so great

Name: Anonymous 2012-01-21 6:59

How come it isn't used outside of academia?

Name: Anonymous 2012-01-22 14:17

>>37
ohhh lisper, always fighting other languages

Name: Anonymous 2012-01-22 14:20

>>30
this is what idiots actually belive!

Name: Anonymous 2012-01-22 15:03

>>30
Lots of Irritating Silly Parens

Name: Anonymous 2012-01-22 15:04

If Lisp is so great, how come it doesn't check my dubs for me?

Name: Anonymous 2012-01-22 15:19

>>39
It has multiple GUI APIs, some portable, some not so much. The ``standard'' GUI API tends to be CLIM which is codified in a standard of its own. If you want something more "modern", you can try Qt ports and similar stuff (also see some commercial implementations).

>>40-43
I don't care what you think or what other people think about the language. Either learn it or stop bitching about it you don't even know it. Lisp has got to be one of the more hated niche languages, yet almost all haters never even learned it, they tend to just get stuck on the syntax or some other trivial non-sense that no true scotsm programmer would ever get stuck on then go and write inflamatory posts all over the Internet/Usenet/... Now if I think harder, I do know one single ``hater'' that actually knows the language well, but the reason he hates it has nothing to do with the language and everything to do with the fact that his employeers don't want him to use Lisp, so he tries to hate it otherwise he'll have to hate his employeers and quit his high paying job.

Name: Anonymous 2012-01-22 15:42

>>45
lisp syntax is fucking shit

parens should burn in hell

Name: Anonymous 2012-01-22 16:32

>>44


(for-each (lambda (thread)
            (for-each (lambda (post)
                        (if (eq (mod (number post) 11) 0)
                          (reply :thread thread
                                 :name ""
                                 :email "sage"
                                 :text ">>%d nice dubz bro[i]![/i]")))
                      (post-list thread)))
          thread-list)

Name: Anonymous 2012-01-22 16:46

>>47
That only works if the post number is only two digits! I suggest you reread SICP and try again.

Name: Anonymous 2012-01-22 17:14

>>48

my goodness!


(defun repeated-digits-unit (digits)
  (if (eq digits 1)
    1
    (+ (expt (repeated-digits-unit (- digits 1)) 10) 1)))

(defun maximum-repeating-postfix-digits (num)
  (labels ((check-digits (digits)
             (cond ((eq digits 1) 1)
                   ((eq (mod (mod num (expt 10 digits))
                             (repeated-digits-unit digits))
                        0)
                    digits)
                   (t check-digits (- digits 1)))))
    (check-digits (ceiling (log 10 num)))))

(for-each (lambda (thread)
            (for-each (lambda (post)
                        (let* ((post-number (number post)))
                              ((arity (maximum-repeating-postfix-digits post-number)))
                             
                        (if (> arity 1)
                          (reply :thread thread
                                 :name ""
                                 :email "sage"
                                 :text (concat ">>"
                                               (string post-number)
                                               " "
                                               (cond ((eq? arity 2) "nice double bro[i]![/i]")
                                                     ((eq? arity 3) "whoa shit! trips! nice trips bro!")
                                                     ((eq? arity 4) "quads! fucken quads! screen cap this shit /b/ros!")
                                                     ((eq? arity 5) "Lok@demQUINTS! EPIC QUINTS BRO!")
                                                     ((eq? arity 6) "those are some sexy sextupples bro.")
                                                     (t "I don't even know the name for that many tuppels bro.")))))))
                      (post-list thread)))
          thread-list)

Name: Anonymous 2012-01-22 17:40

new and improved.


(define reversed-digit-stream (num base)
  (lambda ()
    (if (= num 0)
      #f
      (let ((value (mod num base)))
        (set! num (/ num base))
        value))))

(define (maximum-repeating-prefix-length stream)
  (letrec ((first-value (stream)))
          ((helper (lambda (count)
                     (if (eq? (stream) first-value)
                       (helper (+ count 1))
                       count)))))
    (if (eq? first-value #f)
      0
      (helper 1))))

(define (maximum-repeating-postfix-digits num base)
  (maximum-repeating-prefix-length (reversed-digit-stream num base)))

Name: Anonymous 2012-01-22 18:16

my clojure solution


(defn dubz? [d]
  (>=
    (count (filter
             (fn equal-parts? [n]
               (= 1 (count (distinct (partition n (str d))))))
             (rest
               ((fn factorize [n]
                 (map
                   #(/ n %)
                   (filter #(zero? (rem n %)) (range 1 (+ n 1)))))
               (count (str d))))))
    1))





(dubz? 1)
=> false

(dubz? 11)
=> true

(dubz? 123)
=> false

(dubz? 123123)
=> true

(dubz? 'dubzdubzdubz)
=> true

Name: Anonymous 2012-01-22 18:20

>>51

sorry i should have named it "tupz?" not "dubz?"

Name: Anonymous 2012-01-22 18:30

>>51

oh wow, I never thought about multi digit dubz.

Name: Anonymous 2012-01-22 18:37

>>55
nice dubs bro

Name: Anonymous 2012-01-22 18:38

>>51
Read the specs!

Name: Anonymous 2012-01-22 23:32

rewrote clojure code to use a "tupz" function that returns a key => value map of all tuples found that looks like amount => string


(defn tupz [d]
  (let [d (str d) l (count d)]
   (reduce (fn [tuples size]
     (if (= 1 (count (distinct (partition size d))))
         (assoc tuples (/ l size) (subs d 0 size))
         tuples))
     {}
     ((fn factorize [n]
       (filter #(zero? (rem n %)) (range 1 n)))
     l))))


this way, dubz can be a special case


(defn dubz? [n] (contains? (tupz n) 2))

(defn quadz? [n] (contains? (tupz n) 4))






(dubz? 123123)
=> true

(dubz? 123123123123)
=> true

(quadz? 123123)
=> false

(quadz? 123123123123)
=> true

(tupz 123123123123)
=> {2 "123123", 4 "123"}

Name: Anonymous 2012-01-22 23:37

#include <string.h>
int dubs(char *dubs) {
     size_t n = strlen(dubs);
     if (n < 2) return 0;
     if (dubs[n-1] == dubs[n-2]) return 1;
     return 0;
}

Name: Anonymous 2012-01-22 23:51

>>56

wow. that's mighty compact code there.

Name: Anonymous 2012-01-23 0:06

Returns number of equivalent trailing digits:
+/∧\⊖N[⍴N]⍷N←((⌈10⍟1+N)/10)⊤N←1123456777
Checks for dubs:
=/10 10⊤12344

Name: Anonymous 2012-01-23 0:57

>>3705555577
inb4 shitstorm

Name: Anonymous 2012-01-23 13:41

I fucking love Lisp. But until it gets more popular, Hello Haskell!

Name: Anonymous 2012-01-23 14:34

>>61
until it gets more popular
Do you really believe?

Name: Anonymous 2012-01-23 14:55

>>61
fuck you faggot storm

Name: Anonymous 2012-01-23 16:36

8^2 GET

Name: Anonymous 2012-01-23 16:40

Because the Sussman is a Jew. Lisp is full of Kabbalistic arcana.

Name: Anonymous 2012-01-23 16:41

DIB DAB DUBS

Name: Kaz 2012-01-23 21:05

>>66

That's nothing:

    $ clisp -q
    [1]> (gensym "check-my-dubs-biatchez->")
    #:|check-my-dubs-biatchez->12655|
    [2]>

Ooh yeah ...

Name: Anonymous 2012-01-23 21:36

>>69

Nice position there, you two.

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