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

Pages: 1-

RACKET (Part 1)

Name: Anonymous 2010-07-22 23:33

Racket

Name: Anonymous 2010-07-22 23:40

no

Name: Anonymous 2010-07-23 1:09

Lisp is a racket. It always has been. It is possibly the oldest, easily the most profitable, surely the most vicious. It is the only one international in scope. It is the only one in which the profits are reckoned in dollars and the losses in lives. A racket is best described, I believe, as something that is not what it seems to the majority of the people. Only a small 'inside' group knows what it is about. It is conducted for the benefit of the very few, at the expense of the very many.

Name: VIPPER 2010-07-23 2:34

JEWS

Name: Anonymous 2010-07-23 7:46

LISP is a pyramid scheme

Name: Anonymous 2010-07-23 7:56

learn to spell rocket

Name: Anonymous 2010-07-23 8:09

>>6
learn to spell MY ANUS

Name: Anonymous 2010-07-23 9:07

How do I use macros?

I want to do this (example in C because it's the best language ever and Racket is just a poor reimplementation of half of it):

#define SHORTHAND(name) \
int name##s[42]; \
void grab_##name(int n) { grab(name##s[n]); }

SHORTHAND(penis);

Name: Anonymous 2010-07-23 10:23

>>8
Dicks are generally non-portable. They're tied to each implementation.

Name: Anonymous 2010-07-23 11:02

dickanii

Name: Anonymous 2010-07-23 11:57

>>8
Easy enough in portable CL (tried to make it the same as C, including all limitations (this isn't a good idea, but I'm just faithfully implementing what you proposed), naming conventions converted to CL, so the code would look idiomatic and I don't throw away the grabber's result (more functional that way), even though I could(add a (values) form in the expansion)):


(eval-when (:compile-toplevel :load-toplevel :execute)
  (defun symbolify (&rest symbols)
    (intern (apply #'concatenate 'string (mapcar #'string symbols)))))

(defmacro with-gensyms (names &body body)
  `(let ,(mapcar #'(lambda (name) `(,name (gensym ,(string name)))) names)
     ,@body))

(defmacro shorthand (name &key (key 'grab) (size 42) (type 'u32))
  (with-gensyms (n)
    (let ((var-name (symbolify '* name 's '*))
          (fun-name (symbolify 'grab- name)))     
      `(progn
         (defparameter ,var-name (make-array ,size :element-type ',type))
         (defun ,fun-name (,n)
           (,key (aref ,var-name ,n)))))))

(deftype u32 () '(unsigned-byte 32))

;;; define your own
(defun grab (n) (print n))

;;; Example:

(shorthand small-bomb :type t :size 10)

;;; expands to =>

(progn
  (defparameter *small-bombs* (make-array 10 :element-type 't))
  (defun grab-small-bomb (#:n1244) (grab (aref *small-bombs* #:n1244))))

;; Example usage
CL-USER> (fill *small-bombs* 'beatos)
#(BEATOS BEATOS BEATOS BEATOS BEATOS BEATOS BEATOS BEATOS BEATOS BEATOS)
CL-USER> (grab-small-bomb 3)

BEATOS BEATOS
; the first is printed, the second is the returned value

Name: Anonymous 2010-07-23 12:29

>>11
y do u have to make 1000000 lines for sumthin dat simpel???

Name: Anonymous 2010-07-23 12:40

>>12
The first 2 forms are just utils I copy pasted from a library I'm using. The other things were to allow customization.

Could have I made it 2-3 times shorter? Yes. Was there any point? No. The utils are well-known, and those that have seen them before would ignore them.

Name: Anonymous 2010-07-23 12:59

>>13
FFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUU---

Name: Anonymous 2010-07-23 13:14

>>14
That was unnecessary. Please, close your browser window, it's very cold here.

Name: Anonymous 2010-07-25 14:20

scheme

Name: Anonymous 2010-07-26 1:34

Racket

Name: Anonymous 2010-07-26 1:55

RACKET MY ANUS

Name: Anonymous 2010-07-27 15:26

Debugging a program running on a $100M piece of hardware that is 100 million miles away is an interesting experience. Having a read-eval-print loop running on the spacecraft proved invaluable in finding and fixing the problem.
LISP

Name: Anonymous 2010-07-27 17:14

>>19
Or a C REPL.

Name: Anonymous 2010-07-27 17:51

>>20
Get your decades right, son!

Name: Anonymous 2010-07-27 17:55

>>20
I think I just vomited

Name: Anonymous 2010-07-27 18:19

>>22
%

How about now?

Name: Anonymous 2010-07-27 21:31

>>19
I don't understand, didn't it work the first time?

Name: Anonymous 2010-07-28 5:16

>>24
Perhaps the codes had been modified by alien radiation?

Name: Anonymous 2010-08-05 19:42

(require racket/future)
(processor-count)

Name: Anonymous 2010-08-06 11:04

>>25
Perhaps the codes had been modified by previous alien abduction of the programmers?

Name: Anonymous 2010-08-06 12:35

>>27
MODIFY MY ANUS

Name: Anonymous 2010-08-06 12:43

>>27
PROBE MY ANUS

Name: Anonymous 2010-08-06 13:31

>>29
SAGE MY ANUS

Name: Anonymous 2010-08-06 13:56

>>30
ANUS MY ANUS

Name: Anonymous 2010-08-06 14:22

Racket.

Name: Anonymous 2010-08-06 14:28

>>32
RACKET MY ANUS

Name: Anonymous 2010-11-14 13:57

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