Your SlideShare is downloading. ×
What Does R7RS Change Programming in Scheme?
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

What Does R7RS Change Programming in Scheme?

6,223
views

Published on

Lisp Meet Up presented by Shibuya.lisp #11 (Revised^2) …

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

Published in: Technology

0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
6,223
On Slideshare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
8
Comments
0
Likes
5
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 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. . What is the Schemers’ Soul? Snap out of it, Schemers! K. Hishinuma What Does R7RS Change Programming in Scheme?
  • 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. . What is the Programmers’ Utopia? And..., join us, all lispers and programmers! K. Hishinuma What Does R7RS Change Programming in Scheme?
  • 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. . Congratulation! 1 http://lists.scheme-reports.org/pipermail/ scheme-reports/2013-November/003832.html K. Hishinuma What Does R7RS Change Programming in Scheme?
  • 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. R7RS says ... . “Scheme demonstrates that K. Hishinuma What Does R7RS Change Programming in Scheme?
  • 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. 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. 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. . So, today. Let us think what is The Genuine Programming In R7RS Scheme. K. Hishinuma What Does R7RS Change Programming in Scheme?
  • 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. 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. . 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. . 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. . 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. . define-record-type give Scheme ... K. Hishinuma What Does R7RS Change Programming in Scheme?
  • 19. . define-record-type give Scheme ... The seed of Object-Oriented Programming! K. Hishinuma What Does R7RS Change Programming in Scheme?
  • 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. . Good news! Notation for library system is standardized!! K. Hishinuma What Does R7RS Change Programming in Scheme?
  • 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. . 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. . 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. 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. . What’s this? SRFI-34 is included in R7RS! K. Hishinuma What Does R7RS Change Programming in Scheme?
  • 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. . Other Changes K. Hishinuma What Does R7RS Change Programming in Scheme?
  • 29. . Other Changes Case sensitivity is now the default in symbols and character names. K. Hishinuma What Does R7RS Change Programming in Scheme?
  • 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. . 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. Think in Scheme, write in Scheme, and show your Scheme! Thanks for your listening. K. Hishinuma What Does R7RS Change Programming in Scheme?
  • 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?