Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scheme_syntax_sugars.pdf

Niyarin
June 28, 2019
210

 Scheme_syntax_sugars.pdf

Niyarin

June 28, 2019
Tweet

Transcript

  1. SRFI ・Scheme の拡張の仕様 ・RNRS(Schemeの標準仕様)にたまにマージされる ・内容はいろいろある ・データ構造 SRFI 69 (hash) SRFI113

    (set) ・組み込みデータ構造の処理 SRFI 1 (reduce とか) SRFI 132 (sortとか) ・実用的なやつ SRFI64 (test suite) SRFI 106 (Socket) 2
  2. Syntax Sugar ・S式やめる ・可読性があがる?  ・初心者にはフレンドリー?  ・”Being Popular” では ”I still

    don't find prefix math expressions natural.” Paul Graham (前置記法による数式が自然であるとは思えない)  3
  3. Wisp (SRFI 119)  ルール let      ;(let ((x 1) : x 1

    ; (y 2) y 2 ; (y 3)) body ; body) ・Colon”:” 行頭にある ▶ 下のインデントが閉じるまで、 それ以外  ▶ 行末まで define : f a ;(define (f a) + ; + a 1) a 1 ・ Dot “.” 引数(atom)を並べる list . 1 2 . 3 . 4 ;(list 1 2 3 4) list 1 2 3 ;エラー 4 ;(list (1 2) (3) (4)) 11