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

Post Lisp Code

Name: Anonymous 2012-07-23 3:49

JUST POST SOME FUCK ING LISP!!!!

(defun generate-expr (&key fn-list term-list max-depth method)
  (if (or (= max-depth 0)
      (and (eq method :grow)
           (< (random 1.0)
          (/ (length term-list) (+ (length term-list) (length fn-list))))))
      (nth (random (length term-list)) term-list)
      (let* ((fn (nth (random (length fn-list)) fn-list))
         (arity (length `(swank-backend:arglist ,fn))))
    (cons fn (loop for i from 0 to arity
         collect (generate-expr :fn-list fn-list :term-list term-list :max-depth (1- max-depth) :method method))))))

Name: Anonymous 2013-02-17 9:45

Post Lisp Code

Here is some code from newest Symta:

  (let* ((xs (filter-keywords nil nil ls))
         (ks (car xs))
         (ls (cdr xs))
         (a (unisym))
         (ms (make-hash-table :test 'equal))
         (mm nil))
    ($map (fn (l)
            (let ((hd (lhd (lhd l))))
              (if (fn-sym? hd)
                  (setf l (st ($(ltl (lhd l)) $$(ltl l))))
                  (setf hd "_"))
              (setf (gethash hd ms)
                    (st ($$(gethash hd ms)
                           $(st ((|[]| $(lhd l)) $$(ltl l))))))))
          ls)
    (maphash (fn (hd ls)
               (let* ((x (chain-lambs a ls nil))
                      (*checked-lst-method* (not (string= hd "_")))
                      (y (when *checked-lst-method* (chain-lambs a ls nil))))
                 (setf (gethash hd ms) (cons y x))))
             ms)
    (setf mm (car (gethash "_" ms)))
    (remhash "_" ms)
    (unless (= (hash-table-count ms) 0)
      (let* ((d (unisym))
             (h (unisym))
             (vs nil))
        (maphash (fn (k v) (setf vs (st (($k $(car v) (_fn ($a) $(cdr v))) $$vs))))
                 ms)
        (setf mm
              (st (_let (($d nil) $$($map (fn (v) (lst (lhd v) nil)) vs))
                    (do (set_l $d (_fn () $mm))
                        $$($map (fn (v) (st (set_l $(1st v) $(3rd v)))) vs)
                        (_let (($h (cl (aref $a 0))))
                           (_if (cl (stringp $h))
                                $(search-method h ($map #'rtl vs) d)
                                (c $d)))))))
        ))
    (when name (setf mm (st (cl (block $name ($"@" $mm))))))
    (st (_fn ($a $$(if ks (lst ks))) $mm)))

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