SlideShare a Scribd company logo
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

Scheme 核心概念(一)
Scheme 核心概念(一)Scheme 核心概念(一)
Scheme 核心概念(一)
維然 柯維然
 
Advanced JavaScript Techniques
Advanced JavaScript TechniquesAdvanced JavaScript Techniques
Advanced JavaScript Techniques
Hoat Le
 
Initial Java Core Concept
Initial Java Core ConceptInitial Java Core Concept
Initial Java Core Concept
Rays Technologies
 
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 web
Michiel Borkent
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids Applied
Susan 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 Fall
Yuichi 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 2015
Michiel Borkent
 
Lrz kurse: r as superglue
Lrz kurse: r as superglueLrz kurse: r as superglue
Lrz kurse: r as superglue
Ferdinand Jamitzky
 
Introduction to java 8 stream api
Introduction to java 8 stream apiIntroduction to java 8 stream api
Introduction to java 8 stream api
Vladislav sidlyarevich
 
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 talk
John Stevenson
 
GUL UC3M - Introduction to functional programming
GUL UC3M - Introduction to functional programmingGUL UC3M - Introduction to functional programming
GUL UC3M - Introduction to functional programming
David 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 RxJS
Luis 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 Postscript
Gabriel 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 minutes
Derek 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 Edition
Doc Norton
 
Scheme Programming Language
Scheme Programming LanguageScheme Programming Language
Scheme Programming Language
Reham AlBlehid
 
Python master class 3
Python master class 3Python master class 3
Python master class 3
Chathuranga Bandara
 
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 18
Lar21
 
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
Danielle Madeley
 
Lisp Programming Languge
Lisp Programming LangugeLisp Programming Languge
Lisp Programming Languge
Yaser Jaradeh
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISP
Devnology
 
The Awesome Python Class Part-4
The Awesome Python Class Part-4The Awesome Python Class Part-4
The Awesome Python Class Part-4
Binay Kumar Ray
 
Redis, another step on the road
Redis, another step on the roadRedis, another step on the road
Redis, another step on the road
Yi-Feng Tzeng
 
LISP:Program structure in lisp
LISP:Program structure in lispLISP:Program structure in lisp
LISP:Program structure in lisp
DataminingTools Inc
 
Basic lisp
Basic lispBasic lisp
Basic lisp
Arvind sahu
 
Python master class 2
Python master class 2Python master class 2
Python master class 2
Chathuranga Bandara
 
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
Mike Friedman
 
The Awesome Python Class Part-5
The Awesome Python Class Part-5The Awesome Python Class Part-5
The Awesome Python Class Part-5
Binay Kumar Ray
 
Introduction To Lisp
Introduction To LispIntroduction To Lisp
Introduction To Lisp
kyleburton
 

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
 
Pune Clojure Course Outline
Pune Clojure Course OutlinePune Clojure Course Outline
Pune Clojure Course Outline
Baishampayan Ghose
 
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 JVM
sunng87
 
(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 Management
Albert Bifet
 
EROSについて
EROSについてEROSについて
EROSについて
stibear (stibear1996)
 
Scala in Places API
Scala in Places APIScala in Places API
Scala in Places API
Łukasz Bałamut
 
Clojure Intro
Clojure IntroClojure Intro
Clojure Intro
thnetos
 
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 2012
Leonardo 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 simple
John Stevenson
 
Demystifying functional programming with Scala
Demystifying functional programming with ScalaDemystifying functional programming with Scala
Demystifying functional programming with Scala
Denis
 

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

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 

Recently uploaded (20)

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 

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