(CC Attribution) Lisp 2.1 (Gauche )

Similar documents
つくって学ぶプログラミング言語 RubyによるScheme処理系の実装

r3.dvi

r3.dvi

( ) ( ) ( ) 2


Microsoft PowerPoint Lisp.ppt [互換モード]

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

6-1

haskell.gby

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

1. A0 A B A0 A : A1,...,A5 B : B1,...,B


1

Parametric Polymorphism

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

Microsoft PowerPoint - IntroAlgDs-05-7.ppt

15 Phoenix HTML 15.1 ModestGreeter RAVT web/router.ex web/router.ex : 12 scope "/", ModestGreeter do 13 pipe_through :browser get "/", TopCont

3 3.1 algebraic datatype data k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] B

連立1次方程式Ax=bの解法:公式にしたがって解くのは,計算量大

ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1

2 2.1 NPCMJ ( (Santorini, 2010) (NPCMJ, 2016) (1) (, 2016) (1) (2) (1) ( (IP-MAT (CONJ ) (PP (NP (D ) (N )) (P )) (NP-SBJ *

SCM (v0201) ( ) SCM 2 SCM 3 SCM SCM 2.1 SCM SCM SCM (1) MS-DOS (2) Microsoft(R) Windows 95 (C)Copyright Microsoft Corp

untitled

untitled

51 Lego MindStorms Lisp XS Lego MindStorms 8 CPU RCX RCX Lisp XS XS RCX PC Scheme Lego MindStorms is a robot development kit which makes it possible t

org/ghc/ Windows Linux RPM 3.2 GHCi GHC gcc javac ghc GHCi(ghci) GHCi Prelude> GHCi :load file :l file :also file :a file :reload :r :type expr :t exp

「プログラミング言語」 SICP 第4章 ~超言語的抽象~ その6

導入基礎演習.ppt

Jacques Garrigue

WEBサービス超入門 mask.key


Microsoft PowerPoint - IntroAlgDs-05-2.ppt

2

3 Powered by mod_perl, Apache & MySQL use Item; my $item = Item->new( id => 1, name => ' ', price => 1200,

r07.dvi

ohp07.dvi

untitled

Microsoft PowerPoint - 2-LispProgramming-full



jssst-ocaml.mgp

2 3


̤Äê

ii II Web Web HTML CSS PHP MySQL Web Web CSS JavaScript Web SQL Web

22 (266) / Web PF-Web Web Web Web / Web Web PF-Web Web Web Web CGI Web Web 1 Web PF-Web Web Perl C CGI A Pipe/Filter Architecture Based Software Gener

10 (1) s 10.2 rails c Rails 7 > item = PlanItem.new => #<PlanItem id nil, name nil,...> > item.name = "" => "" > item.valid? => true valid? true false

untitled

Webベースプログラミング学習支援環境 Wappen と WappenLite について


地域と文化資産


Common Lisp :

Microsoft PowerPoint L02-Introduction-students ( )

jakld-lecture13.pptx

Microsoft PowerPoint - IntroAlgDs-06-8.ppt

109 i Lisp KVM Java VM Lisp Java Lisp JAKLD KVM Lisp JAKLD Java Lisp KVM API We present a Lisp system that can be downloaded to and used on mobile pho

ohp07.dvi

bdd.gby

橡matufw

untitled

O

NewBead_no17_4c_pdf.indd


財団法人母子健康協会第三十回シンポジウム

Appendix A BASIC BASIC Beginner s All-purpose Symbolic Instruction Code FORTRAN COBOL C JAVA PASCAL (NEC N88-BASIC Windows BASIC (1) (2) ( ) BASIC BAS

プログラミングD - Java


外為オンライン FX 取引 操作説明書

1 2

untitled

INDEX

INDEX

1002goody_bk_作業用

2015_kisyuu


橡Pascal-Tの挙動を調べる

Web2.0 LL Framework Ruby on Rails / TurboGears / CakePHP Atlas Web2.0 XML Selenium / JMeter 3 Ajax Web 2.0 UI Ruby on Rails Web 2. ASP.NET AJAX,

Safari AppletViewer Web HTML Netscape Web Web 15-1 Applet Web Applet init Web paint Web start Web HTML stop destroy update init Web paint start Web up

橡告改.PDF

ストラドプロシージャの呼び出し方

IPSJ SIG Technical Report Vol.2015-CLE-16 No /5/23 RESTful Web API Web 1,2,3,4,a) 1,3,2,4 5,6 6 Wannous Muhammad 7,1,8 4,2,1 3,2,1 Maxima Web JS

Local variable x y i paint public class Sample extends Applet { public void paint( Graphics gc ) { int x, y;... int i=10 ; while ( i < 100 ) {... i +=

BOX BOX 19 4 i

Condition DAQ condition condition 2 3 XML key value

ld-2.dvi

オンラインテスト


untitled

I117 II I117 PROGRAMMING PRACTICE II SOFTWARE DEVELOPMENT ENV. 1 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara

橡実践Oracle Objects for OLE

Sinatra と MongoDB 今回は Sinatra で MongoDB の操作を体験してみます 進捗に合わせて ドライバから Ruby で使える便利な ORM の紹介をします

Copyright c 2008 Zhenjiang Hu, All Right Reserved.

javascript key

2 Mar Java (2) Java 3 Java (1) Java 19),20) Scheme Java car public static void Lcar(BCI bci) { Object x = bci.vs[bci.vsbase + 1]; if (!(x instan

account4-1.PDF

PBASIC 2.5 PBASIC 2.5 $PBASIC directive PIN type New DEBUG control characters DEBUGIN Line continuation for comma-delimited lists IF THEN ELSE * SELEC

- 1 -

%

ID010-2

Transcription:

http://www.flickr.com/photos/dust/3603580129/ (CC Attribution) Lisp 2.1 (Gauche )

2

2000EY-Office 3

4

Lisp 5

New York The lisps Sammy Tunis flickr lisp http://www.flickr.com/photos/dust/3603580129/ (CC Attribution) 6

Lisp S Lisp (Lisp) 7

Lisp http://www.flickr.com/photos/dust/3603580129/ (CC Attribution) 8

LispLL 1960 1970 1980 1990 2000 FORTAN C C++ Java C# ALGOL Pascal Simula COBOL Lisp1.5 Common Lisp Scheme Perl Ruby Smalltalk Python Prolog Haskell Javascript 9

Lisp Perl,Ruby,Python, Javascript... (Lisp) Java,Perl,Ruby, Python, Javascript... Haskell,Scale (Ruby, Javascript...)!?!? 10

11

GC (Garbage collection) 12

13

(Symbolic Expression) 14

15

S http://www.flickr.com/photos/dust/3603580129/ (CC Attribution) 16

S 17

S 18

S 19

S 20

S 21

S 22

23

24

Lisp http://www.flickr.com/photos/dust/3603580129/ (CC Attribution) 25

% rlwrap gosh gosh> (+ 1 2) 3 gosh> (* 2 (+ 3 4)) 14 gosh> 26

gosh> (define a 3) a gosh> a 3 gosh> (define b (+ 2 5)) b gosh> b 7 gosh> (+ a b) 10 27

gosh> (set! a (+ a 1)) 4 gosh> a 4 gosh> c *** ERROR: unbound variable: c gosh> 28

gosh> (let ((a 2) (b 3)) (set! a (+ a 1)) (+ a b)) 6 gosh> 29

gosh> (define (add3 n) (+ n 3)) add3 gosh> (add3 5) 8 gosh> (add3 (add3 4)) 10 30

quote gosh> c *** ERROR: unbound variable: c Stack Trace: gosh> (quote c) c gosh> 'c c gosh> 31

quote gosh> (x y z) *** ERROR: unbound variable: y Stack Trace: gosh> '(x y z) (x y z) gosh> (append '(a b) '(c d)) (a b c d) gosh> 32

S gosh> (car '(a b c)) a gosh> (cdr '(a b c)) (b c) gosh> (cons 'a '(b c)) (a b c) gosh> 33

gosh> (define (fact n) (if (= n 0) 1 (* n (fact (- n 1))))) fact gosh> (fact 3) 6 gosh> (fact 10) 3628800 gosh> 34

gosh> (define sample '(html (body (h1 "Lisp") (table (tr (td 1) (td "lisp")) (tr (td 2) (td "scheme")))))) sample gosh> (print-html sample) <html><body><h1>lisp</h1><table><tr><td>1</td><td>lisp</ td></tr><tr><td>2</td><td>scheme</td></tr></table></ body></html>#<undef> gosh> 35

36

(define (print-html e) (if (list? e) (begin (format #t "<~a>" (car e)) (print-html-list (cdr e)) (format #t "</~a>" (car e))) (display e))) 37

(define (print-html-list l) (if (null? l) #f (begin (print-html (car l)) (print-html-list (cdr l))))) 38

(define (print-html-list l) (until (null? l) (print-html (car l)) (set! l (cdr l)))) 39

Lisp http://www.flickr.com/photos/dust/3603580129/ (CC Attribution) 40

41

> (if (not (= 0 1)) (print "not-eq") (print "eq")) not-eq > (not-if (= 0 1) (print "not-eq") (print "eq")) not-eq 42

(define-macro (not-if test then else) (list 'if (list 'not test) then else)) gosh> (not-if (= 0 1) (print "not-eq") (print "eq")) not-eq #<undef> gosh> (not-if (= 0 0) (print "not-eq") (print "eq")) eq #<undef> 43

(define-macro (not-if test then else) (list 'if (list 'not test) then else)) > (let ((test '(= 0 1)) (then '(print "not-eq")) (else '(print "eq"))) (list 'if (list 'not test) then else)) (if (not (= 0 1)) (print "not-eq") (print "eq")) 44

(define-macro (not-if test then else) `(if (not,test),then,else) gosh> (let ((a 2) (b 3)) `(add,a (sub 5,(+ b 1)))) (add 2 (sub 5 4)) gosh> 45

DSL (define-action index (set! @todos (find <todo> :all))) (define-action show (set! @todo (find <todo> (params :id)))) (define-action edit (set! @todo (find <todo> (params :id))) (define-continuation edit (when (update_attributes @todo (params :todo)) (flash :notice "todo was successfully updated.") (redirect :action 'index)))) 46

Lisp 47

REPL 48

eval () 49

env () 50

51

gosh> (define (add2 n) (+ n 2)) add2 gosh> (add2 3) 5 gosh> (define add2 (lambda(n) (+ n 2))) add2 gosh> (add2 3) 5 gosh> 52

Lisp 53

54

http://www.flickr.com/photos/dust/3603580129/ (CC Attribution) 2.1 55