.

.

What Does R7RS
Change Programming in Scheme?
Kazuhiro Hishinuma (Twitter: @kazh98)
Department of Computer Science, M...
. What is the Schemers’ Soul?

Snap out of it, Schemers!

K. Hishinuma

What Does R7RS Change Programming in Scheme?
. What is the Schemers’ Soul?

Snap out of it, Schemers!
Scheme is the simplest,
the smallest, and
the most powerful langu...
. What is the Programmers’ Utopia?

And..., join us,
all lispers and programmers!

K. Hishinuma

What Does R7RS Change Pro...
. What is the Programmers’ Utopia?

And..., join us,
all lispers and programmers!
Now, the most ideal language
is going to...
. Congratulation!

1

http://lists.scheme-reports.org/pipermail/
scheme-reports/2013-November/003832.html
K. Hishinuma

Wh...
. Congratulation!

R7RS-small draft
ratified by Steering Committee!! 1

1

http://lists.scheme-reports.org/pipermail/
schem...
R7RS says ...
.

“Scheme demonstrates that

K. Hishinuma

What Does R7RS Change Programming in Scheme?
R7RS says ...
.

“Scheme demonstrates that
a very small number of rules
for forming expressions,

K. Hishinuma

What Does ...
R7RS says ...
.

“Scheme demonstrates that
a very small number of rules
for forming expressions, with no restrictions

K. ...
R7RS says ...
.

“Scheme demonstrates that
a very small number of rules
for forming expressions, with no restrictions
on h...
. So, today.

Let us think what is
The Genuine Programming
In R7RS Scheme.

K. Hishinuma

What Does R7RS Change Programmin...
Three Hot Changes1
.

Record-type (cf. pp.27–)
Library System (cf. pp.28–)
Exceptions (cf. pp.54–)

1

from R5 RS
K. Hishi...
Three Hot Changes1
.

Record-type (cf. pp.27–)
Library System (cf. pp.28–)
Exceptions (cf. pp.54–)

1

from R5 RS
K. Hishi...
. Record-type




(define-record-type name
(cname f1 f2 ...)
pred?
(f1 ref-f1 set-f1 !)
(f2 ref-f2 set-f2 !)
...)




name ...
. e.g. CONS, CAR, CDR
Existing method:




(define (cons a b)
(lambda (s) (s a b)))
(define (car c)
(c (lambda (a b) a)))
(d...
. e.g. CONS, CAR, CDR
Proposed method:




(define-record-type pair
(cons a b)
pair?
(a car set-car!)
(b cdr set-cdr!))



...
. define-record-type give Scheme ...

K. Hishinuma

What Does R7RS Change Programming in Scheme?
. define-record-type give Scheme ...

The seed of
Object-Oriented Programming!

K. Hishinuma

What Does R7RS Change Program...
Three Hot Changes1
.

Record-type (cf. pp.27–)
Library System (cf. pp.28–)
Exceptions (cf. pp.54–)

1

from R5 RS
K. Hishi...
. Good news!

Notation for library system
is standardized!!

K. Hishinuma

What Does R7RS Change Programming in Scheme?
. How to load SRFI-1

Gauche (use srfi-1)
Guile (srfi srfi-1)
Racket (require srfi/1)

K. Hishinuma

What Does R7RS Change Pro...
. How to load SRFI-1

Gauche (use srfi-1)
Guile (srfi srfi-1)
Racket (require srfi/1)
R7RS (import (srfi 1))

K. Hishinuma

Wha...
. How to make a library




(define-library (name ...)
(export ep ...)
(import (scheme base) ...)
(begin
(define (p1 args .....
Three Hot Changes1
.

Record-type (cf. pp.27–)
Library System (cf. pp.28–)
Exceptions (cf. pp.54–)

K. Hishinuma

What Doe...
. What’s this?

SRFI-34 is included
in R7RS!

K. Hishinuma

What Does R7RS Change Programming in Scheme?
. with-exception-handler

e.g.





(with-exception-handler
(lambda (e) Handler for Exception e)
(lambda () Procedure whic...
. Other Changes

K. Hishinuma

What Does R7RS Change Programming in Scheme?
. Other Changes

Case sensitivity is now the default in
symbols and character names.

K. Hishinuma

What Does R7RS Change ...
. Other Changes

Case sensitivity is now the default in
symbols and character names.
Case-lambda (cf. pp.21–)

K. Hishinum...
. Other Changes

Case sensitivity is now the default in
symbols and character names.
Case-lambda (cf. pp.21–)
The call-wit...
Think in Scheme,
write in Scheme,
and show your Scheme!
Thanks for your listening.

K. Hishinuma

What Does R7RS Change Pr...
. References
[1] J. Cowan: R7RS-small draft ratified by Steering Committee.
The public mailing lists on lists.scheme-report...
Upcoming SlideShare
Loading in …5
×

What Does R7RS Change Programming in Scheme?

8,507 views

Published on

Lisp Meet Up presented by Shibuya.lisp #11 (Revised^2)
http://atnd.org/events/45403

Published in: Technology
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,507
On SlideShare
0
From Embeds
0
Number of Embeds
3,121
Actions
Shares
0
Downloads
13
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

What Does R7RS Change Programming in Scheme?

  1. 1. . . What Does R7RS Change Programming in Scheme? Kazuhiro Hishinuma (Twitter: @kazh98) Department of Computer Science, Meiji University 1-1-1 Higashimita, Tama-ku, Kawasaki-shi, Kanagawa, 214-8571 Japan K. Hishinuma What Does R7RS Change Programming in Scheme?
  2. 2. . What is the Schemers’ Soul? Snap out of it, Schemers! K. Hishinuma What Does R7RS Change Programming in Scheme?
  3. 3. . What is the Schemers’ Soul? Snap out of it, Schemers! Scheme is the simplest, the smallest, and the most powerful language! K. Hishinuma What Does R7RS Change Programming in Scheme?
  4. 4. . What is the Programmers’ Utopia? And..., join us, all lispers and programmers! K. Hishinuma What Does R7RS Change Programming in Scheme?
  5. 5. . What is the Programmers’ Utopia? And..., join us, all lispers and programmers! Now, the most ideal language is going to be born! K. Hishinuma What Does R7RS Change Programming in Scheme?
  6. 6. . Congratulation! 1 http://lists.scheme-reports.org/pipermail/ scheme-reports/2013-November/003832.html K. Hishinuma What Does R7RS Change Programming in Scheme?
  7. 7. . Congratulation! R7RS-small draft ratified by Steering Committee!! 1 1 http://lists.scheme-reports.org/pipermail/ scheme-reports/2013-November/003832.html K. Hishinuma What Does R7RS Change Programming in Scheme?
  8. 8. R7RS says ... . “Scheme demonstrates that K. Hishinuma What Does R7RS Change Programming in Scheme?
  9. 9. R7RS says ... . “Scheme demonstrates that a very small number of rules for forming expressions, K. Hishinuma What Does R7RS Change Programming in Scheme?
  10. 10. R7RS says ... . “Scheme demonstrates that a very small number of rules for forming expressions, with no restrictions K. Hishinuma What Does R7RS Change Programming in Scheme?
  11. 11. R7RS says ... . “Scheme demonstrates that a very small number of rules for forming expressions, with no restrictions on how they are composed.” K. Hishinuma What Does R7RS Change Programming in Scheme?
  12. 12. . So, today. Let us think what is The Genuine Programming In R7RS Scheme. K. Hishinuma What Does R7RS Change Programming in Scheme?
  13. 13. Three Hot Changes1 . Record-type (cf. pp.27–) Library System (cf. pp.28–) Exceptions (cf. pp.54–) 1 from R5 RS K. Hishinuma What Does R7RS Change Programming in Scheme?
  14. 14. Three Hot Changes1 . Record-type (cf. pp.27–) Library System (cf. pp.28–) Exceptions (cf. pp.54–) 1 from R5 RS K. Hishinuma What Does R7RS Change Programming in Scheme?
  15. 15. . Record-type (define-record-type name (cname f1 f2 ...) pred? (f1 ref-f1 set-f1 !) (f2 ref-f2 set-f2 !) ...) name Name of the record to be defined pred? Name of the predicatior for this record f1 , f2 , ... Names of the fields of this record K. Hishinuma What Does R7RS Change Programming in Scheme?
  16. 16. . e.g. CONS, CAR, CDR Existing method: (define (cons a b) (lambda (s) (s a b))) (define (car c) (c (lambda (a b) a))) (define (cdr c) (c (lambda (a b) b))) (define c (cons ’a ’b)) (car c) ;= ’a (cdr c) ;= ’b K. Hishinuma (pair? c) ;= ?! (set-car! c ’d) (car c) ;= ?! What Does R7RS Change Programming in Scheme?
  17. 17. . e.g. CONS, CAR, CDR Proposed method: (define-record-type pair (cons a b) pair? (a car set-car!) (b cdr set-cdr!)) (define c (cons ’a ’b)) (car c) ;= ’a (cdr c) ;= ’b K. Hishinuma (pair? c) ;= #t (set-car! c ’d) (car c) ;= ’d What Does R7RS Change Programming in Scheme?
  18. 18. . define-record-type give Scheme ... K. Hishinuma What Does R7RS Change Programming in Scheme?
  19. 19. . define-record-type give Scheme ... The seed of Object-Oriented Programming! K. Hishinuma What Does R7RS Change Programming in Scheme?
  20. 20. Three Hot Changes1 . Record-type (cf. pp.27–) Library System (cf. pp.28–) Exceptions (cf. pp.54–) 1 from R5 RS K. Hishinuma What Does R7RS Change Programming in Scheme?
  21. 21. . Good news! Notation for library system is standardized!! K. Hishinuma What Does R7RS Change Programming in Scheme?
  22. 22. . How to load SRFI-1 Gauche (use srfi-1) Guile (srfi srfi-1) Racket (require srfi/1) K. Hishinuma What Does R7RS Change Programming in Scheme?
  23. 23. . How to load SRFI-1 Gauche (use srfi-1) Guile (srfi srfi-1) Racket (require srfi/1) R7RS (import (srfi 1)) K. Hishinuma What Does R7RS Change Programming in Scheme?
  24. 24. . How to make a library (define-library (name ...) (export ep ...) (import (scheme base) ...) (begin (define (p1 args ...) ...) ...)) name Name of the library ep ... List of names to be exported K. Hishinuma What Does R7RS Change Programming in Scheme?
  25. 25. Three Hot Changes1 . Record-type (cf. pp.27–) Library System (cf. pp.28–) Exceptions (cf. pp.54–) K. Hishinuma What Does R7RS Change Programming in Scheme?
  26. 26. . What’s this? SRFI-34 is included in R7RS! K. Hishinuma What Does R7RS Change Programming in Scheme?
  27. 27. . with-exception-handler e.g. (with-exception-handler (lambda (e) Handler for Exception e) (lambda () Procedure which may raise exception)) (error ”This is an error message.”) K. Hishinuma What Does R7RS Change Programming in Scheme?
  28. 28. . Other Changes K. Hishinuma What Does R7RS Change Programming in Scheme?
  29. 29. . Other Changes Case sensitivity is now the default in symbols and character names. K. Hishinuma What Does R7RS Change Programming in Scheme?
  30. 30. . Other Changes Case sensitivity is now the default in symbols and character names. Case-lambda (cf. pp.21–) K. Hishinuma What Does R7RS Change Programming in Scheme?
  31. 31. . Other Changes Case sensitivity is now the default in symbols and character names. Case-lambda (cf. pp.21–) The call-with-current-continuation procedure now has the synonym call/cc. K. Hishinuma What Does R7RS Change Programming in Scheme?
  32. 32. Think in Scheme, write in Scheme, and show your Scheme! Thanks for your listening. K. Hishinuma What Does R7RS Change Programming in Scheme?
  33. 33. . References [1] J. Cowan: R7RS-small draft ratified by Steering Committee. The public mailing lists on lists.scheme-reports.org, 2013. http://lists.scheme-reports.org/pipermail/ scheme-reports/2013-November/003832.html [2] A. Shinn, J. Cowan, and A. Gleckler: Revised7 Report on the Algorithmic Language Scheme. Steering Committee, Scheme Working Groups, 2013. http://trac.sacrideo.us/wg/ [3] Y. Kurosaki, and K. Hishinuma: Meiji Scheme Shell improved by MOL. Meiji Scheme Project, Mathematical Optimization Laboratory, Meiji University. https://github.com/meshmol/mesh [4] K. Sasagawa: Normal Scheme. Scheme, 2013. http://homepage1.nifty.com/~skz/Scheme/normal.html K. Hishinuma What Does R7RS Change Programming in Scheme?

×