Home » Source Code » cons-dispatch


2012-06-09 11:45:09
The author
Download(s): 0
Point (s): 1 
Category Category:
bookbook Lisp/SchemeLisp/Scheme


- CONS" m)))))
(define (mycar z) (z 'car))
(define (mycdr z) (z 'cdr))
(define (mysetcar! z newx) (z 'setcar newx))
(define (mysetcdr! z newy) (z 'setcdr newy))
(define k (mycons 1 2))
(write (list (mycar k) (mycdr k) k))
(mysetcdr! k -2)
(write (list (mycar k) (mycdr k)))
(mysetcar! k 12)
(write (list (mycar k) (mycdr k)))
(mysetcar! k 5) (mysetcdr! k 33)
(write (list (mycar k) (mycdr k)))

; --> (1 2 #<procedure:/t.scm:3:2>)(1 -2)(12 -2)(5 33)

; because it is Scheme you could remove all my's and this code would redefine car, cons etc.

Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
0.00 B
Sponsored links


(Add your comment, get 0.1 Point)
Minimum:15 words, Maximum:160 words
  • 1
  • Page 1
  • Total 1

cons-dispatch (362.00 B)

Need 1 Point(s)
Your Point (s)

Your Point isn't enough.

Get 22 Point immediately by PayPal

Point will be added to your account automatically after the transaction.

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more Points


Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com


CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D