SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
.

.

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?
. 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 language!
K. Hishinuma

What Does R7RS Change Programming in Scheme?
. What is the Programmers’ Utopia?

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

K. Hishinuma

What Does R7RS Change Programming in Scheme?
. 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?
. Congratulation!

1

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

What Does R7RS Change Programming in Scheme?
. 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?
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 Change Programming in Scheme?
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?
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?
. So, today.

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

K. Hishinuma

What Does R7RS Change Programming in Scheme?
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?
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?
. 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?
. 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?
. 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?
. 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 Programming in Scheme?
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?
. 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 Programming in Scheme?
. 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?
. 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?
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?
. 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 which may raise exception))






(error ”This is an error message.”)




K. Hishinuma

What Does R7RS Change Programming in Scheme?
. 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 Programming in Scheme?
. 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?
. 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?
Think in Scheme,
write in Scheme,
and show your Scheme!
Thanks for your listening.

K. Hishinuma

What Does R7RS Change Programming in Scheme?
. 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?

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Simplilearn
 

Was ist angesagt? (20)

Kubernetes best practices with GKE
Kubernetes best practices with GKEKubernetes best practices with GKE
Kubernetes best practices with GKE
 
Cloud Native: what is it? Why?
Cloud Native: what is it? Why?Cloud Native: what is it? Why?
Cloud Native: what is it? Why?
 
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
 
CI/CD (DevOps) 101
CI/CD (DevOps) 101CI/CD (DevOps) 101
CI/CD (DevOps) 101
 
DevOps
DevOps DevOps
DevOps
 
Red Hat Openshift Fundamentals.pptx
Red Hat Openshift Fundamentals.pptxRed Hat Openshift Fundamentals.pptx
Red Hat Openshift Fundamentals.pptx
 
Building scalable OTT workflows on AWS - Serverless Video Workflows
Building scalable OTT workflows on AWS - Serverless Video WorkflowsBuilding scalable OTT workflows on AWS - Serverless Video Workflows
Building scalable OTT workflows on AWS - Serverless Video Workflows
 
The what, why and how of knative
The what, why and how of knativeThe what, why and how of knative
The what, why and how of knative
 
NGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for KubernetesNGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for Kubernetes
 
Introduction of kubernetes rancher
Introduction of kubernetes rancherIntroduction of kubernetes rancher
Introduction of kubernetes rancher
 
DevOps Introduction
DevOps IntroductionDevOps Introduction
DevOps Introduction
 
AWS DevOps vs Azure DevOps | | Difference AWS DevOps and Azure DevOps
AWS DevOps vs Azure DevOps |  | Difference AWS DevOps and Azure DevOpsAWS DevOps vs Azure DevOps |  | Difference AWS DevOps and Azure DevOps
AWS DevOps vs Azure DevOps | | Difference AWS DevOps and Azure DevOps
 
DevOps Engineer [Arabic]
DevOps Engineer [Arabic]DevOps Engineer [Arabic]
DevOps Engineer [Arabic]
 
Using Zabbix in IoT Architecture
Using Zabbix in IoT ArchitectureUsing Zabbix in IoT Architecture
Using Zabbix in IoT Architecture
 
DevOps : mission [im]possible ?
DevOps : mission [im]possible ?DevOps : mission [im]possible ?
DevOps : mission [im]possible ?
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
GitOps and ArgoCD
GitOps and ArgoCDGitOps and ArgoCD
GitOps and ArgoCD
 
프론트엔드개발 버전 표기 방법 가이드 라인
프론트엔드개발 버전 표기 방법 가이드 라인프론트엔드개발 버전 표기 방법 가이드 라인
프론트엔드개발 버전 표기 방법 가이드 라인
 

Ähnlich wie What Does R7RS Change Programming in Scheme?

r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packages
Ajay Ohri
 
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Hsien-Hsin Sean Lee, Ph.D.
 

Ähnlich wie What Does R7RS Change Programming in Scheme? (20)

What's new in Apache SystemML - Declarative Machine Learning
What's new in Apache SystemML  - Declarative Machine LearningWhat's new in Apache SystemML  - Declarative Machine Learning
What's new in Apache SystemML - Declarative Machine Learning
 
Interm codegen
Interm codegenInterm codegen
Interm codegen
 
SystemML - Declarative Machine Learning
SystemML - Declarative Machine LearningSystemML - Declarative Machine Learning
SystemML - Declarative Machine Learning
 
Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly Language
 
LISP: назад в будущее, Микола Мозговий
LISP: назад в будущее, Микола МозговийLISP: назад в будущее, Микола Мозговий
LISP: назад в будущее, Микола Мозговий
 
Fun never stops. introduction to haskell programming language
Fun never stops. introduction to haskell programming languageFun never stops. introduction to haskell programming language
Fun never stops. introduction to haskell programming language
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packages
 
Implementing R7RS on R6RS Scheme
Implementing R7RS on R6RS SchemeImplementing R7RS on R6RS Scheme
Implementing R7RS on R6RS Scheme
 
AllBits presentation - Lower Level SW Security
AllBits presentation - Lower Level SW SecurityAllBits presentation - Lower Level SW Security
AllBits presentation - Lower Level SW Security
 
Easy R
Easy REasy R
Easy R
 
Survey of Program Transformation Technologies
Survey of Program Transformation TechnologiesSurvey of Program Transformation Technologies
Survey of Program Transformation Technologies
 
LISP: Introduction to lisp
LISP: Introduction to lispLISP: Introduction to lisp
LISP: Introduction to lisp
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To Lisp
 
07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilation07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilation
 
A brief introduction to lisp language
A brief introduction to lisp languageA brief introduction to lisp language
A brief introduction to lisp language
 
R programming
R programmingR programming
R programming
 
Assembly language part I
Assembly language part IAssembly language part I
Assembly language part I
 
Assembly language part I
Assembly language part IAssembly language part I
Assembly language part I
 
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
 
Declarative Semantics Definition - Term Rewriting
Declarative Semantics Definition - Term RewritingDeclarative Semantics Definition - Term Rewriting
Declarative Semantics Definition - Term Rewriting
 

Mehr von Kazuhiro Hishinuma

Lisper は競プロを楽しめるか?
Lisper は競プロを楽しめるか?Lisper は競プロを楽しめるか?
Lisper は競プロを楽しめるか?
Kazuhiro Hishinuma
 
#upcamp '12 Hack-a-thon Result
#upcamp '12 Hack-a-thon Result#upcamp '12 Hack-a-thon Result
#upcamp '12 Hack-a-thon Result
Kazuhiro Hishinuma
 

Mehr von Kazuhiro Hishinuma (17)

Properties of a Convex Set in Linear Space
Properties of a Convex Set in Linear SpaceProperties of a Convex Set in Linear Space
Properties of a Convex Set in Linear Space
 
大学生活概論
大学生活概論大学生活概論
大学生活概論
 
床下からCommon Lisp
床下からCommon Lisp床下からCommon Lisp
床下からCommon Lisp
 
すべてをRacketに取り込もう! ~Racket FFI と Package システムの使い方~
すべてをRacketに取り込もう! ~Racket FFI と Package システムの使い方~すべてをRacketに取り込もう! ~Racket FFI と Package システムの使い方~
すべてをRacketに取り込もう! ~Racket FFI と Package システムの使い方~
 
不動点×不動点×不動点コンビネータ
不動点×不動点×不動点コンビネータ不動点×不動点×不動点コンビネータ
不動点×不動点×不動点コンビネータ
 
最急降下法で制約つき最適化問題を解いてみた
最急降下法で制約つき最適化問題を解いてみた最急降下法で制約つき最適化問題を解いてみた
最急降下法で制約つき最適化問題を解いてみた
 
再帰でつくる、計算の世界
再帰でつくる、計算の世界再帰でつくる、計算の世界
再帰でつくる、計算の世界
 
Implementation of Counters in ScopedBASIC
Implementation of Counters in ScopedBASICImplementation of Counters in ScopedBASIC
Implementation of Counters in ScopedBASIC
 
Lisper は競プロを楽しめるか?
Lisper は競プロを楽しめるか?Lisper は競プロを楽しめるか?
Lisper は競プロを楽しめるか?
 
GaucheでCGIプログラミング
GaucheでCGIプログラミングGaucheでCGIプログラミング
GaucheでCGIプログラミング
 
How to Implement a CPU Emulator in Scheme
How to Implement a CPU Emulator in SchemeHow to Implement a CPU Emulator in Scheme
How to Implement a CPU Emulator in Scheme
 
明治大の活動2
明治大の活動2明治大の活動2
明治大の活動2
 
明治大の活動予告
明治大の活動予告明治大の活動予告
明治大の活動予告
 
The Programming Language Scheme
The Programming Language SchemeThe Programming Language Scheme
The Programming Language Scheme
 
情報と職業プレゼン予告
情報と職業プレゼン予告情報と職業プレゼン予告
情報と職業プレゼン予告
 
#upcamp '12 Hack-a-thon Result
#upcamp '12 Hack-a-thon Result#upcamp '12 Hack-a-thon Result
#upcamp '12 Hack-a-thon Result
 
Scoped BASIC Presentation1
Scoped BASIC Presentation1Scoped BASIC Presentation1
Scoped BASIC Presentation1
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

What Does R7RS Change Programming in Scheme?

  • 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?
  • 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?