SlideShare a Scribd company logo
1 of 20
Download to read offline
Meta-objective
    Lisp
          @dico_leque
 2011/02/26 NagoyaRejectKaigi
n   Common Lisp Object System     Metaobject
    Protocol

n                 Gauche Scheme interpreter
Lisp
n   CLOS -- Common Lisp Object System
n


    n   ISLISP Object System -- ILOS

n   Ruby

n   ANSI Common Lisp                    Lisp
CLOS (1)

n


    n   (define-class <foo> () ((slot1) (slot2)))
n


    n   (define-class <baz> (<foo> <bar>) ())
CLOS (2)
n                                                         generic-
    function

n

     (define-generic foo)
     (define-method foo ((x            <sequence>) (y <sequence>)) 0)
     (define-method foo ((x            <sequence>) (y <string>)) 1)
     (define-method foo ((x            <string>) (y <sequence>)) 2)
     (define-method foo ((x            <string>) (y <string>)) 3)

     (foo   '()   '())    ;   =>   0
     (foo   '()   "a")    ;   =>   1
     (foo   "a"   '#())   ;   =>   2
     (foo   "a"   "b")    ;   =>   3
CLOS (3)
n   CLOS   CLOS

n




n
MOP
n   Metaobject Protocol
    n   introspection:
                          API

    n   intercessory:
                         API

n          intercessory
Metaobjects

n


    n   <class> <generic> <method>
n

    (make <class>) (apply-generic-function <generic>)
(1)
n


n   <singleton-meta>
         make

n   (instance-of <     >)



n   singleton               singleton
(1)
(define-class <singleton-meta> (<class>)
  (%the-singleton-instance)
  )

(define-method make ((class <singleton-meta>) . initargs)
  ...)

(define-method instance-of ((class <singleton-meta>) . initargs)
  (apply make class initargs))

(define-class <singleton-mixin> ()
  ()
  :metaclass <singleton-meta>)



            from gauche/lib/gauche/mop/singleton.scm
(2) O/R

n   DB

n   <orm>             DB
(2) O/R
(define-class <orm> (<class>) ())

(define-method compute-slots ((cl <orm>))
  (let ((super-slots (next-method)))
    (lset-union
     (lambda (x y)
       (eq? (car x) (car y)))
     (map (lambda (name)
            `(,name
              :init-keyword ,(make-keyword name)
              :accessor ,(string->symbol (format "~A-of" name))))
          (load-slot-names cl))
     super-slots)))

(define-class <foo> () ()
  :metaclass <orm>)
                               ※ load-slot-names
(3)
n   Ruby

n


n   (eql 0)           0



n   <generic>             (eql x)
(3)

(define-generic fact
  :class <eql-specializable-generic>)

(define-method fact ((n (eql 0)))
  1)

(define-method fact ((n <integer>))
  (* n (fact (- n 1))))
(3)
(define-class <eql-specializer> (<class>)
  ((object
    :getter eql-specializer-object
    :init-keyword :eql-specializer-object)))

(define (eql obj)
  (make <eql-specializer> :eql-specializer-object obj))

(define-class <eql-specializable-generic> (<generic>) ())

(define-method compute-applicable-methods
    ((gf <eql-specializable-generic>) args)
  ...)

(define-method sort-applicable-methods
    ((gf <eql-specializable-generic>) methods args)
  ...)
      ※                60       http://d.hatena.ne.jp/leque/20110105/p1
CLOS / MOP

n




    n               DB



    n


    n   validator
CLOS / MOP
n


    n

        Pascal Costanza, Charlotte Herzeel, Jorge Vallejos, Theo D’Hondt:
        “Filtered dispatch”, Proceedings of the 2008 symposium on Dynamic
        languages

n


    n                                before, after, around

    n
CLOS / MOP

n


    n


    n   lazy initialization

n
DSL       MOP

n   DSL    Domain



n
n   Lisper
    DSL
n   CLOS MOP

More Related Content

What's hot

Advanced JavaScript Techniques
Advanced JavaScript TechniquesAdvanced JavaScript Techniques
Advanced JavaScript TechniquesHoat Le
 
Gaucheで本を作る
Gaucheで本を作るGaucheで本を作る
Gaucheで本を作るguest7a66b8
 
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신Sungchul Park
 
ClojureScript for the web
ClojureScript for the webClojureScript for the web
ClojureScript for the webMichiel Borkent
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedSusan Potter
 
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallJavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallYuichi Sakuraba
 
Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”Platonov Sergey
 
ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015Michiel Borkent
 
Extend R with Rcpp!!!
Extend R with Rcpp!!!Extend R with Rcpp!!!
Extend R with Rcpp!!!mickey24
 
Clojure made simple - Lightning talk
Clojure made simple - Lightning talkClojure made simple - Lightning talk
Clojure made simple - Lightning talkJohn Stevenson
 
GUL UC3M - Introduction to functional programming
GUL UC3M - Introduction to functional programmingGUL UC3M - Introduction to functional programming
GUL UC3M - Introduction to functional programmingDavid Muñoz Díaz
 
Java8 stream
Java8 streamJava8 stream
Java8 streamkoji lin
 
Luis Atencio on RxJS
Luis Atencio on RxJSLuis Atencio on RxJS
Luis Atencio on RxJSLuis Atencio
 
Javascript engine performance
Javascript engine performanceJavascript engine performance
Javascript engine performanceDuoyi Wu
 
Безопасность интернет-приложений осень 2013 лекция 10
Безопасность интернет-приложений осень 2013 лекция 10Безопасность интернет-приложений осень 2013 лекция 10
Безопасность интернет-приложений осень 2013 лекция 10Technopark
 

What's hot (20)

Scheme 核心概念(一)
Scheme 核心概念(一)Scheme 核心概念(一)
Scheme 核心概念(一)
 
Advanced JavaScript Techniques
Advanced JavaScript TechniquesAdvanced JavaScript Techniques
Advanced JavaScript Techniques
 
Initial Java Core Concept
Initial Java Core ConceptInitial Java Core Concept
Initial Java Core Concept
 
Gaucheで本を作る
Gaucheで本を作るGaucheで本を作る
Gaucheで本を作る
 
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
 
Slides
SlidesSlides
Slides
 
ClojureScript for the web
ClojureScript for the webClojureScript for the web
ClojureScript for the web
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids Applied
 
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallJavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
 
Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”
 
ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015
 
Lrz kurse: r as superglue
Lrz kurse: r as superglueLrz kurse: r as superglue
Lrz kurse: r as superglue
 
Introduction to java 8 stream api
Introduction to java 8 stream apiIntroduction to java 8 stream api
Introduction to java 8 stream api
 
Extend R with Rcpp!!!
Extend R with Rcpp!!!Extend R with Rcpp!!!
Extend R with Rcpp!!!
 
Clojure made simple - Lightning talk
Clojure made simple - Lightning talkClojure made simple - Lightning talk
Clojure made simple - Lightning talk
 
GUL UC3M - Introduction to functional programming
GUL UC3M - Introduction to functional programmingGUL UC3M - Introduction to functional programming
GUL UC3M - Introduction to functional programming
 
Java8 stream
Java8 streamJava8 stream
Java8 stream
 
Luis Atencio on RxJS
Luis Atencio on RxJSLuis Atencio on RxJS
Luis Atencio on RxJS
 
Javascript engine performance
Javascript engine performanceJavascript engine performance
Javascript engine performance
 
Безопасность интернет-приложений осень 2013 лекция 10
Безопасность интернет-приложений осень 2013 лекция 10Безопасность интернет-приложений осень 2013 лекция 10
Безопасность интернет-приложений осень 2013 лекция 10
 

Viewers also liked

lisps - A Lisp Interpreter written in Postscript
lisps - A Lisp Interpreter written in Postscriptlisps - A Lisp Interpreter written in Postscript
lisps - A Lisp Interpreter written in PostscriptGabriel Grill
 
How to build a realtime, WebSockets-enabled chat in less than 5 minutes
How to build a realtime, WebSockets-enabled chat in less than 5 minutesHow to build a realtime, WebSockets-enabled chat in less than 5 minutes
How to build a realtime, WebSockets-enabled chat in less than 5 minutesDerek Edwards
 
Scheme language brief introduction
Scheme language brief introductionScheme language brief introduction
Scheme language brief introductionCarpen ZJ Wang
 
Introduction To Functional Programming with Scheme - LeanDog Edition
Introduction To Functional Programming with Scheme - LeanDog EditionIntroduction To Functional Programming with Scheme - LeanDog Edition
Introduction To Functional Programming with Scheme - LeanDog EditionDoc Norton
 
Scheme Programming Language
Scheme Programming LanguageScheme Programming Language
Scheme Programming LanguageReham AlBlehid
 
Dive into Python Class
Dive into Python ClassDive into Python Class
Dive into Python ClassJim Yeh
 
Flask - Backend com Python - Semcomp 18
Flask - Backend com Python - Semcomp 18Flask - Backend com Python - Semcomp 18
Flask - Backend com Python - Semcomp 18Lar21
 
Writing your first web app using Python and Flask
Writing your first web app using Python and FlaskWriting your first web app using Python and Flask
Writing your first web app using Python and FlaskDanielle Madeley
 
Lisp Programming Languge
Lisp Programming LangugeLisp Programming Languge
Lisp Programming LangugeYaser Jaradeh
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISPDevnology
 
The Awesome Python Class Part-4
The Awesome Python Class Part-4The Awesome Python Class Part-4
The Awesome Python Class Part-4Binay Kumar Ray
 
Redis, another step on the road
Redis, another step on the roadRedis, another step on the road
Redis, another step on the roadYi-Feng Tzeng
 
Building Scalable, Distributed Job Queues with Redis and Redis::Client
Building Scalable, Distributed Job Queues with Redis and Redis::ClientBuilding Scalable, Distributed Job Queues with Redis and Redis::Client
Building Scalable, Distributed Job Queues with Redis and Redis::ClientMike Friedman
 
The Awesome Python Class Part-5
The Awesome Python Class Part-5The Awesome Python Class Part-5
The Awesome Python Class Part-5Binay Kumar Ray
 
Introduction To Lisp
Introduction To LispIntroduction To Lisp
Introduction To Lispkyleburton
 

Viewers also liked (20)

lisps - A Lisp Interpreter written in Postscript
lisps - A Lisp Interpreter written in Postscriptlisps - A Lisp Interpreter written in Postscript
lisps - A Lisp Interpreter written in Postscript
 
How to build a realtime, WebSockets-enabled chat in less than 5 minutes
How to build a realtime, WebSockets-enabled chat in less than 5 minutesHow to build a realtime, WebSockets-enabled chat in less than 5 minutes
How to build a realtime, WebSockets-enabled chat in less than 5 minutes
 
Scheme language brief introduction
Scheme language brief introductionScheme language brief introduction
Scheme language brief introduction
 
Introduction To Functional Programming with Scheme - LeanDog Edition
Introduction To Functional Programming with Scheme - LeanDog EditionIntroduction To Functional Programming with Scheme - LeanDog Edition
Introduction To Functional Programming with Scheme - LeanDog Edition
 
Scheme Programming Language
Scheme Programming LanguageScheme Programming Language
Scheme Programming Language
 
Python master class 3
Python master class 3Python master class 3
Python master class 3
 
Dive into Python Class
Dive into Python ClassDive into Python Class
Dive into Python Class
 
Flask for cs students
Flask for cs studentsFlask for cs students
Flask for cs students
 
Flask - Backend com Python - Semcomp 18
Flask - Backend com Python - Semcomp 18Flask - Backend com Python - Semcomp 18
Flask - Backend com Python - Semcomp 18
 
Writing your first web app using Python and Flask
Writing your first web app using Python and FlaskWriting your first web app using Python and Flask
Writing your first web app using Python and Flask
 
Lisp Programming Languge
Lisp Programming LangugeLisp Programming Languge
Lisp Programming Languge
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISP
 
The Awesome Python Class Part-4
The Awesome Python Class Part-4The Awesome Python Class Part-4
The Awesome Python Class Part-4
 
Redis, another step on the road
Redis, another step on the roadRedis, another step on the road
Redis, another step on the road
 
LISP:Program structure in lisp
LISP:Program structure in lispLISP:Program structure in lisp
LISP:Program structure in lisp
 
Basic lisp
Basic lispBasic lisp
Basic lisp
 
Python master class 2
Python master class 2Python master class 2
Python master class 2
 
Building Scalable, Distributed Job Queues with Redis and Redis::Client
Building Scalable, Distributed Job Queues with Redis and Redis::ClientBuilding Scalable, Distributed Job Queues with Redis and Redis::Client
Building Scalable, Distributed Job Queues with Redis and Redis::Client
 
The Awesome Python Class Part-5
The Awesome Python Class Part-5The Awesome Python Class Part-5
The Awesome Python Class Part-5
 
Introduction To Lisp
Introduction To LispIntroduction To Lisp
Introduction To Lisp
 

Similar to Meta-objective Lisp @名古屋 Reject 会議

Lisp Macros in 20 Minutes (Featuring Clojure)
Lisp Macros in 20 Minutes (Featuring Clojure)Lisp Macros in 20 Minutes (Featuring Clojure)
Lisp Macros in 20 Minutes (Featuring Clojure)Phil Calçado
 
Clojure for Java developers - Stockholm
Clojure for Java developers - StockholmClojure for Java developers - Stockholm
Clojure for Java developers - StockholmJan Kronquist
 
CL metaprogramming
CL metaprogrammingCL metaprogramming
CL metaprogrammingdudarev
 
Clojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVMClojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVMsunng87
 
(map Clojure everyday-tasks)
(map Clojure everyday-tasks)(map Clojure everyday-tasks)
(map Clojure everyday-tasks)Jacek Laskowski
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
Real Time Big Data Management
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data ManagementAlbert Bifet
 
Clojure Intro
Clojure IntroClojure Intro
Clojure Introthnetos
 
Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기JangHyuk You
 
Continuation Passing Style and Macros in Clojure - Jan 2012
Continuation Passing Style and Macros in Clojure - Jan 2012Continuation Passing Style and Macros in Clojure - Jan 2012
Continuation Passing Style and Macros in Clojure - Jan 2012Leonardo Borges
 
Pointcuts and Analysis
Pointcuts and AnalysisPointcuts and Analysis
Pointcuts and AnalysisWiwat Ruengmee
 
A Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingA Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingGarth Gilmour
 
Lisp как универсальная обертка
Lisp как универсальная оберткаLisp как универсальная обертка
Lisp как универсальная оберткаVsevolod Dyomkin
 
Clojure made really really simple
Clojure made really really simpleClojure made really really simple
Clojure made really really simpleJohn Stevenson
 
Demystifying functional programming with Scala
Demystifying functional programming with ScalaDemystifying functional programming with Scala
Demystifying functional programming with ScalaDenis
 

Similar to Meta-objective Lisp @名古屋 Reject 会議 (20)

Lisp Macros in 20 Minutes (Featuring Clojure)
Lisp Macros in 20 Minutes (Featuring Clojure)Lisp Macros in 20 Minutes (Featuring Clojure)
Lisp Macros in 20 Minutes (Featuring Clojure)
 
Pune Clojure Course Outline
Pune Clojure Course OutlinePune Clojure Course Outline
Pune Clojure Course Outline
 
Clojure for Java developers - Stockholm
Clojure for Java developers - StockholmClojure for Java developers - Stockholm
Clojure for Java developers - Stockholm
 
Hw09 Hadoop + Clojure
Hw09   Hadoop + ClojureHw09   Hadoop + Clojure
Hw09 Hadoop + Clojure
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
CL metaprogramming
CL metaprogrammingCL metaprogramming
CL metaprogramming
 
Clojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVMClojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVM
 
(map Clojure everyday-tasks)
(map Clojure everyday-tasks)(map Clojure everyday-tasks)
(map Clojure everyday-tasks)
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Real Time Big Data Management
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data Management
 
EROSについて
EROSについてEROSについて
EROSについて
 
Scala in Places API
Scala in Places APIScala in Places API
Scala in Places API
 
Clojure Intro
Clojure IntroClojure Intro
Clojure Intro
 
Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기
 
Continuation Passing Style and Macros in Clojure - Jan 2012
Continuation Passing Style and Macros in Clojure - Jan 2012Continuation Passing Style and Macros in Clojure - Jan 2012
Continuation Passing Style and Macros in Clojure - Jan 2012
 
Pointcuts and Analysis
Pointcuts and AnalysisPointcuts and Analysis
Pointcuts and Analysis
 
A Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingA Sceptical Guide to Functional Programming
A Sceptical Guide to Functional Programming
 
Lisp как универсальная обертка
Lisp как универсальная оберткаLisp как универсальная обертка
Lisp как универсальная обертка
 
Clojure made really really simple
Clojure made really really simpleClojure made really really simple
Clojure made really really simple
 
Demystifying functional programming with Scala
Demystifying functional programming with ScalaDemystifying functional programming with Scala
Demystifying functional programming with Scala
 

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 

Meta-objective Lisp @名古屋 Reject 会議

  • 1. Meta-objective Lisp @dico_leque 2011/02/26 NagoyaRejectKaigi
  • 2. n Common Lisp Object System Metaobject Protocol n Gauche Scheme interpreter
  • 3. Lisp n CLOS -- Common Lisp Object System n n ISLISP Object System -- ILOS n Ruby n ANSI Common Lisp Lisp
  • 4. CLOS (1) n n (define-class <foo> () ((slot1) (slot2))) n n (define-class <baz> (<foo> <bar>) ())
  • 5. CLOS (2) n generic- function n (define-generic foo) (define-method foo ((x <sequence>) (y <sequence>)) 0) (define-method foo ((x <sequence>) (y <string>)) 1) (define-method foo ((x <string>) (y <sequence>)) 2) (define-method foo ((x <string>) (y <string>)) 3) (foo '() '()) ; => 0 (foo '() "a") ; => 1 (foo "a" '#()) ; => 2 (foo "a" "b") ; => 3
  • 6. CLOS (3) n CLOS CLOS n n
  • 7. MOP n Metaobject Protocol n introspection: API n intercessory: API n intercessory
  • 8. Metaobjects n n <class> <generic> <method> n (make <class>) (apply-generic-function <generic>)
  • 9. (1) n n <singleton-meta> make n (instance-of < >) n singleton singleton
  • 10. (1) (define-class <singleton-meta> (<class>) (%the-singleton-instance) ) (define-method make ((class <singleton-meta>) . initargs) ...) (define-method instance-of ((class <singleton-meta>) . initargs) (apply make class initargs)) (define-class <singleton-mixin> () () :metaclass <singleton-meta>) from gauche/lib/gauche/mop/singleton.scm
  • 11. (2) O/R n DB n <orm> DB
  • 12. (2) O/R (define-class <orm> (<class>) ()) (define-method compute-slots ((cl <orm>)) (let ((super-slots (next-method))) (lset-union (lambda (x y) (eq? (car x) (car y))) (map (lambda (name) `(,name :init-keyword ,(make-keyword name) :accessor ,(string->symbol (format "~A-of" name)))) (load-slot-names cl)) super-slots))) (define-class <foo> () () :metaclass <orm>) ※ load-slot-names
  • 13. (3) n Ruby n n (eql 0) 0 n <generic> (eql x)
  • 14. (3) (define-generic fact :class <eql-specializable-generic>) (define-method fact ((n (eql 0))) 1) (define-method fact ((n <integer>)) (* n (fact (- n 1))))
  • 15. (3) (define-class <eql-specializer> (<class>) ((object :getter eql-specializer-object :init-keyword :eql-specializer-object))) (define (eql obj) (make <eql-specializer> :eql-specializer-object obj)) (define-class <eql-specializable-generic> (<generic>) ()) (define-method compute-applicable-methods ((gf <eql-specializable-generic>) args) ...) (define-method sort-applicable-methods ((gf <eql-specializable-generic>) methods args) ...) ※ 60 http://d.hatena.ne.jp/leque/20110105/p1
  • 16. CLOS / MOP n n DB n n validator
  • 17. CLOS / MOP n n Pascal Costanza, Charlotte Herzeel, Jorge Vallejos, Theo D’Hondt: “Filtered dispatch”, Proceedings of the 2008 symposium on Dynamic languages n n before, after, around n
  • 18. CLOS / MOP n n n lazy initialization n
  • 19. DSL MOP n DSL Domain n
  • 20. n Lisper DSL n CLOS MOP