ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
LISPS
by Alex & Gabriel
A Lisp Interpreter in Postscript
¡ñ Scheme dialect based on Peter Norvig's
  lispy (lisp interpreter in python)
  http://norvig.com/lispy.html

¡ñ Scheme dialect
  ¡ð   variables                 var
  ¡ð   conditional               (if test conseq alt)
  ¡ð   definition / assignment   (define var value)
  ¡ð   procedure                 (lambda (var...) exp)
  ¡ð   sequencing                (begin exp...)
  ¡ð   procedure call            (procedure exp...)
Good use of Concepts
¡ñ Parser
    ¡ð List with arbitrary length
  /pdict_default <<
    40 { count 0 eq { mark } { isMark not { mark } if } ifelse mark }   %
'('
    41 { isMark { pop } { genStr transit } ifelse eval mark } % ')'
    32 { isMark not { genStr transit mark } if } % ' '
  >> def

  readline
  {
    dup pdict exch known      % is current character in dict
    { pdict exch get exec }   % execute mapped code
    if
  } forall                    % for all characters in readline
Good use of Concepts
¡ñ Dictionaries / Parser
   ¡ð state change with dictionaries
 /pdict pdict_default def

 /pdict_states <<
   (lambda) { /pdict pdict_lambda def mark }
   (quote) { /pdict pdict_quote def }
 >> def

 /pdict_lambda <<
   40 { }                                      % '(' do not delete
   41 { isMark { pop } { genStr } ifelse ]
        mark /pdict pdict_default def }        % ')'
   32 { isMark not { genStr mark } if }        % ' '
 >> def
Good use of Concepts
¡ñ eval
  ¡ð reorder with stack
 /eval % op p1..pn - { p1..pn { op } exec }
 {
    counttomark -1 roll
    dup dictionary exch known % test if command is known
    { dictionary exch get exec }
    { { call_fun } }
    ifelse
    0 ] cvx dup dup length 1 sub {exec} putinterval
 } def
Good use of Concepts
¡ñ Dictionaries
   ¡ð map for variables
   ¡ð bind Scheme commands to PostScript words
/dictionary <<
 ...
 (if) {{myif}} (quote) {{quote}} (define) {{mydef}}
 (set!) {{myset}} (lambda) {lambda}
 (begin) { prebegin {mybegin}} (equal?) {{eq}} (eq?) {{eq}}
 (length) {{getVal length}} (cons) {{cons}} (car) {{getVal 0 get}}
 (cdr) {{cdr}} (append) {{append}} (list) { list } (list?) {{isList}}
 (null?) {{null}}
>> def
Good use of Concepts
¡ñ Lists
    ¡ð example: Scheme command begin
                       (begin) {prebegin {mybegin}}

  /prebegin {
     ] mark exch % make an array of all parameters begin will get and
recreate the used mark for parser
  } def

 /mybegin {
    mark exch % set mark where this command's parameter begins
    { getVal } forall % evaluate each subexpression in right order
    ] dup length 1 sub get % make array of all outputs and get last one
 } def
Good use of Concepts
¡ñ lambda
  ¡ð code Injection
 /lambda {
   12 array dup 0    % workaround
   { null % function that is executed
     null % array of par_names
     isCall 3 array dup 0
     { set_pars getVal clearpars }
     putinterval cvx
     { exch lambda append_par_arr }
     ifelse
   } putinterval cvx
   dup 1 5 -1 roll put
   dup 0 4 -1 roll put
 } def
Fin
Any Questions?




Code available:
https://github.com/grill/lisps

More Related Content

What's hot (20)

C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1
Ammara Javed
?
[C++]3 loop statement
[C++]3 loop statement[C++]3 loop statement
[C++]3 loop statement
Junyoung Jung
?
Python functions and loops
Python functions and loopsPython functions and loops
Python functions and loops
thirumurugan133
?
GNAT Pro User Day: Ada 2012, Ravenscar and SPARK running on an Atmel ARM M4 (...
GNAT Pro User Day: Ada 2012, Ravenscar and SPARK running on an Atmel ARM M4 (...GNAT Pro User Day: Ada 2012, Ravenscar and SPARK running on an Atmel ARM M4 (...
GNAT Pro User Day: Ada 2012, Ravenscar and SPARK running on an Atmel ARM M4 (...
AdaCore
?
C++ Programming Club-Lecture 2
C++ Programming Club-Lecture 2C++ Programming Club-Lecture 2
C++ Programming Club-Lecture 2
Ammara Javed
?
Decision statements in c language
Decision statements in c languageDecision statements in c language
Decision statements in c language
tanmaymodi4
?
C++ programming
C++ programmingC++ programming
C++ programming
viancagerone
?
04greedy 2x2
04greedy 2x204greedy 2x2
04greedy 2x2
Ankit Malik
?
Introduction to python programming [part 1]
Introduction to python programming [part 1]Introduction to python programming [part 1]
Introduction to python programming [part 1]
Akhil Nadh PC
?
C++ control loops
C++ control loopsC++ control loops
C++ control loops
pratikborsadiya
?
Reconstruction
ReconstructionReconstruction
Reconstruction
COMSATS Abbottabad
?
C programming-apurbo datta
C programming-apurbo dattaC programming-apurbo datta
C programming-apurbo datta
Apurbo Datta
?
4th_Ed_Ch03.pdf
4th_Ed_Ch03.pdf4th_Ed_Ch03.pdf
4th_Ed_Ch03.pdf
ShifatiRabbi
?
C++ Programming Club-Lecture 3
C++ Programming Club-Lecture 3C++ Programming Club-Lecture 3
C++ Programming Club-Lecture 3
Ammara Javed
?
Basic c++ programs
Basic c++ programsBasic c++ programs
Basic c++ programs
harman kaur
?
C++ loop
C++ loop C++ loop
C++ loop
Khelan Ameen
?
C++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabsC++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabs
Stephane Gleizes
?
Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)
Sumant Tambe
?
MSc Thesis Defense Presentation
MSc Thesis Defense PresentationMSc Thesis Defense Presentation
MSc Thesis Defense Presentation
Mostafa Elhoushi
?
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
Muhammad Ulhaque
?
C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1
Ammara Javed
?
GNAT Pro User Day: Ada 2012, Ravenscar and SPARK running on an Atmel ARM M4 (...
GNAT Pro User Day: Ada 2012, Ravenscar and SPARK running on an Atmel ARM M4 (...GNAT Pro User Day: Ada 2012, Ravenscar and SPARK running on an Atmel ARM M4 (...
GNAT Pro User Day: Ada 2012, Ravenscar and SPARK running on an Atmel ARM M4 (...
AdaCore
?
C++ Programming Club-Lecture 2
C++ Programming Club-Lecture 2C++ Programming Club-Lecture 2
C++ Programming Club-Lecture 2
Ammara Javed
?
Decision statements in c language
Decision statements in c languageDecision statements in c language
Decision statements in c language
tanmaymodi4
?
Introduction to python programming [part 1]
Introduction to python programming [part 1]Introduction to python programming [part 1]
Introduction to python programming [part 1]
Akhil Nadh PC
?
C programming-apurbo datta
C programming-apurbo dattaC programming-apurbo datta
C programming-apurbo datta
Apurbo Datta
?
C++ Programming Club-Lecture 3
C++ Programming Club-Lecture 3C++ Programming Club-Lecture 3
C++ Programming Club-Lecture 3
Ammara Javed
?
C++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabsC++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabs
Stephane Gleizes
?
Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)
Sumant Tambe
?
MSc Thesis Defense Presentation
MSc Thesis Defense PresentationMSc Thesis Defense Presentation
MSc Thesis Defense Presentation
Mostafa Elhoushi
?
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
ECSE 221 - Introduction to Computer Engineering - Tutorial 1 - Muhammad Ehtas...
Muhammad Ulhaque
?

Similar to lisps - A Lisp Interpreter written in Postscript (20)

Parsers Combinators in Scala, Ilya @lambdamix Kliuchnikov
Parsers Combinators in Scala, Ilya @lambdamix KliuchnikovParsers Combinators in Scala, Ilya @lambdamix Kliuchnikov
Parsers Combinators in Scala, Ilya @lambdamix Kliuchnikov
Vasil Remeniuk
?
CLISP Lab Manual - Dr.J.VijiPriya
CLISP Lab Manual - Dr.J.VijiPriyaCLISP Lab Manual - Dr.J.VijiPriya
CLISP Lab Manual - Dr.J.VijiPriya
VijiPriya Jeyamani
?
Ch2
Ch2Ch2
Ch2
kinnarshah8888
?
Parboiled explained
Parboiled explainedParboiled explained
Parboiled explained
Paul Popoff
?
Implementing External DSLs Using Scala Parser Combinators
Implementing External DSLs Using Scala Parser CombinatorsImplementing External DSLs Using Scala Parser Combinators
Implementing External DSLs Using Scala Parser Combinators
Tim Dalton
?
Introducing Pattern Matching in Scala
 Introducing Pattern Matching  in Scala Introducing Pattern Matching  in Scala
Introducing Pattern Matching in Scala
Ayush Mishra
?
CL metaprogramming
CL metaprogrammingCL metaprogramming
CL metaprogramming
dudarev
?
Custom Pregel Algorithms in ArangoDB
Custom Pregel Algorithms in ArangoDBCustom Pregel Algorithms in ArangoDB
Custom Pregel Algorithms in ArangoDB
ArangoDB Database
?
CS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic ServicesCS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic Services
Eelco Visser
?
Experimental dtrace
Experimental dtraceExperimental dtrace
Experimental dtrace
Matthew Ahrens
?
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
?
Matlab commands
Matlab commandsMatlab commands
Matlab commands
avinashkumer
?
Matlab commands
Matlab commandsMatlab commands
Matlab commands
Thim Mengly(??????,ÃÏÀî)
?
ANSI C REFERENCE CARD
ANSI C REFERENCE CARDANSI C REFERENCE CARD
ANSI C REFERENCE CARD
Tia Ricci
?
Mastering Grammars with PetitParser
Mastering Grammars with PetitParserMastering Grammars with PetitParser
Mastering Grammars with PetitParser
Lukas Renggli
?
Ch2 (1).ppt
Ch2 (1).pptCh2 (1).ppt
Ch2 (1).ppt
daniloalbay1
?
Declarative Semantics Definition - Term Rewriting
Declarative Semantics Definition - Term RewritingDeclarative Semantics Definition - Term Rewriting
Declarative Semantics Definition - Term Rewriting
Guido Wachsmuth
?
Lex (lexical analyzer)
Lex (lexical analyzer)Lex (lexical analyzer)
Lex (lexical analyzer)
Sami Said
?
MuVM: Higher Order Mutation Analysis Virtual Machine for C
MuVM: Higher Order Mutation Analysis Virtual Machine for CMuVM: Higher Order Mutation Analysis Virtual Machine for C
MuVM: Higher Order Mutation Analysis Virtual Machine for C
Susumu Tokumoto
?
shellScriptAlt.pptx
shellScriptAlt.pptxshellScriptAlt.pptx
shellScriptAlt.pptx
NiladriDey18
?
Parsers Combinators in Scala, Ilya @lambdamix Kliuchnikov
Parsers Combinators in Scala, Ilya @lambdamix KliuchnikovParsers Combinators in Scala, Ilya @lambdamix Kliuchnikov
Parsers Combinators in Scala, Ilya @lambdamix Kliuchnikov
Vasil Remeniuk
?
CLISP Lab Manual - Dr.J.VijiPriya
CLISP Lab Manual - Dr.J.VijiPriyaCLISP Lab Manual - Dr.J.VijiPriya
CLISP Lab Manual - Dr.J.VijiPriya
VijiPriya Jeyamani
?
Parboiled explained
Parboiled explainedParboiled explained
Parboiled explained
Paul Popoff
?
Implementing External DSLs Using Scala Parser Combinators
Implementing External DSLs Using Scala Parser CombinatorsImplementing External DSLs Using Scala Parser Combinators
Implementing External DSLs Using Scala Parser Combinators
Tim Dalton
?
Introducing Pattern Matching in Scala
 Introducing Pattern Matching  in Scala Introducing Pattern Matching  in Scala
Introducing Pattern Matching in Scala
Ayush Mishra
?
CL metaprogramming
CL metaprogrammingCL metaprogramming
CL metaprogramming
dudarev
?
Custom Pregel Algorithms in ArangoDB
Custom Pregel Algorithms in ArangoDBCustom Pregel Algorithms in ArangoDB
Custom Pregel Algorithms in ArangoDB
ArangoDB Database
?
CS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic ServicesCS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic Services
Eelco Visser
?
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
?
ANSI C REFERENCE CARD
ANSI C REFERENCE CARDANSI C REFERENCE CARD
ANSI C REFERENCE CARD
Tia Ricci
?
Mastering Grammars with PetitParser
Mastering Grammars with PetitParserMastering Grammars with PetitParser
Mastering Grammars with PetitParser
Lukas Renggli
?
Declarative Semantics Definition - Term Rewriting
Declarative Semantics Definition - Term RewritingDeclarative Semantics Definition - Term Rewriting
Declarative Semantics Definition - Term Rewriting
Guido Wachsmuth
?
Lex (lexical analyzer)
Lex (lexical analyzer)Lex (lexical analyzer)
Lex (lexical analyzer)
Sami Said
?
MuVM: Higher Order Mutation Analysis Virtual Machine for C
MuVM: Higher Order Mutation Analysis Virtual Machine for CMuVM: Higher Order Mutation Analysis Virtual Machine for C
MuVM: Higher Order Mutation Analysis Virtual Machine for C
Susumu Tokumoto
?

Recently uploaded (20)

SAP Business Data Cloud: Was die neue SAP-L?sung f¨¹r Unternehmen und ihre Dat...
SAP Business Data Cloud: Was die neue SAP-L?sung f¨¹r Unternehmen und ihre Dat...SAP Business Data Cloud: Was die neue SAP-L?sung f¨¹r Unternehmen und ihre Dat...
SAP Business Data Cloud: Was die neue SAP-L?sung f¨¹r Unternehmen und ihre Dat...
IBsolution GmbH
?
Dragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN NB-IoT LTE cat.M1ÉÌÆ·¥ê¥¹¥È
Dragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN  NB-IoT  LTE cat.M1ÉÌÆ·¥ê¥¹¥ÈDragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN  NB-IoT  LTE cat.M1ÉÌÆ·¥ê¥¹¥È
Dragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN NB-IoT LTE cat.M1ÉÌÆ·¥ê¥¹¥È
CRI Japan, Inc.
?
RBM - PIXIAGE - AskPixi Page - Inpixon-MWC 2025.pptx
RBM - PIXIAGE - AskPixi Page - Inpixon-MWC 2025.pptxRBM - PIXIAGE - AskPixi Page - Inpixon-MWC 2025.pptx
RBM - PIXIAGE - AskPixi Page - Inpixon-MWC 2025.pptx
quinlan4
?
A General introduction to Ad ranking algorithms
A General introduction to Ad ranking algorithmsA General introduction to Ad ranking algorithms
A General introduction to Ad ranking algorithms
Buhwan Jeong
?
Java on AWS Without the Headaches - Fast Builds, Cheap Deploys, No Kubernetes
Java on AWS Without the Headaches - Fast Builds, Cheap Deploys, No KubernetesJava on AWS Without the Headaches - Fast Builds, Cheap Deploys, No Kubernetes
Java on AWS Without the Headaches - Fast Builds, Cheap Deploys, No Kubernetes
VictorSzoltysek
?
Automated Engineering of Domain-Specific Metamorphic Testing Environments
Automated Engineering of Domain-Specific Metamorphic Testing EnvironmentsAutomated Engineering of Domain-Specific Metamorphic Testing Environments
Automated Engineering of Domain-Specific Metamorphic Testing Environments
Pablo G¨®mez Abajo
?
APAC Solutions Challenge Info Session.pdf
APAC Solutions Challenge Info Session.pdfAPAC Solutions Challenge Info Session.pdf
APAC Solutions Challenge Info Session.pdf
GDG on Campus Monash
?
HHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptx
HHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptxHHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptx
HHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptx
HampshireHUG
?
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025
Sugarlab AI
?
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
DianaGray10
?
Building High-Impact Teams Beyond the Product Triad.pdf
Building High-Impact Teams Beyond the Product Triad.pdfBuilding High-Impact Teams Beyond the Product Triad.pdf
Building High-Impact Teams Beyond the Product Triad.pdf
Rafael Burity
?
CIOs Speak Out - A Research Series by Jasper Colin
CIOs Speak Out - A Research Series by Jasper ColinCIOs Speak Out - A Research Series by Jasper Colin
CIOs Speak Out - A Research Series by Jasper Colin
Jasper Colin
?
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-World
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-WorldAll-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-World
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-World
Safe Software
?
Scalable Multi-Agent AI with AutoGen by Udai
Scalable Multi-Agent AI with AutoGen by UdaiScalable Multi-Agent AI with AutoGen by Udai
Scalable Multi-Agent AI with AutoGen by Udai
Udaiappa Ramachandran
?
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
DOCOMO Innovations, Inc.
?
Packaging your App for AppExchange ¨C Managed Vs Unmanaged.pptx
Packaging your App for AppExchange ¨C Managed Vs Unmanaged.pptxPackaging your App for AppExchange ¨C Managed Vs Unmanaged.pptx
Packaging your App for AppExchange ¨C Managed Vs Unmanaged.pptx
mohayyudin7826
?
Rens van de Schoot - Mensen, machines en de zoektocht naar het laatste releva...
Rens van de Schoot - Mensen, machines en de zoektocht naar het laatste releva...Rens van de Schoot - Mensen, machines en de zoektocht naar het laatste releva...
Rens van de Schoot - Mensen, machines en de zoektocht naar het laatste releva...
voginip
?
How to Consistently Make $5,000+ with DeepSmartX
How to Consistently Make $5,000+ with DeepSmartXHow to Consistently Make $5,000+ with DeepSmartX
How to Consistently Make $5,000+ with DeepSmartX
SOFTTECHHUB
?
The Future of Materials: Transitioning from Silicon to Alternative Metals
The Future of Materials: Transitioning from Silicon to Alternative MetalsThe Future of Materials: Transitioning from Silicon to Alternative Metals
The Future of Materials: Transitioning from Silicon to Alternative Metals
anupriti
?
Innovative Web Design | Malachite Technologies
Innovative Web Design | Malachite TechnologiesInnovative Web Design | Malachite Technologies
Innovative Web Design | Malachite Technologies
malachitetechnologie1
?
SAP Business Data Cloud: Was die neue SAP-L?sung f¨¹r Unternehmen und ihre Dat...
SAP Business Data Cloud: Was die neue SAP-L?sung f¨¹r Unternehmen und ihre Dat...SAP Business Data Cloud: Was die neue SAP-L?sung f¨¹r Unternehmen und ihre Dat...
SAP Business Data Cloud: Was die neue SAP-L?sung f¨¹r Unternehmen und ihre Dat...
IBsolution GmbH
?
Dragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN NB-IoT LTE cat.M1ÉÌÆ·¥ê¥¹¥È
Dragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN  NB-IoT  LTE cat.M1ÉÌÆ·¥ê¥¹¥ÈDragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN  NB-IoT  LTE cat.M1ÉÌÆ·¥ê¥¹¥È
Dragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN NB-IoT LTE cat.M1ÉÌÆ·¥ê¥¹¥È
CRI Japan, Inc.
?
RBM - PIXIAGE - AskPixi Page - Inpixon-MWC 2025.pptx
RBM - PIXIAGE - AskPixi Page - Inpixon-MWC 2025.pptxRBM - PIXIAGE - AskPixi Page - Inpixon-MWC 2025.pptx
RBM - PIXIAGE - AskPixi Page - Inpixon-MWC 2025.pptx
quinlan4
?
A General introduction to Ad ranking algorithms
A General introduction to Ad ranking algorithmsA General introduction to Ad ranking algorithms
A General introduction to Ad ranking algorithms
Buhwan Jeong
?
Java on AWS Without the Headaches - Fast Builds, Cheap Deploys, No Kubernetes
Java on AWS Without the Headaches - Fast Builds, Cheap Deploys, No KubernetesJava on AWS Without the Headaches - Fast Builds, Cheap Deploys, No Kubernetes
Java on AWS Without the Headaches - Fast Builds, Cheap Deploys, No Kubernetes
VictorSzoltysek
?
Automated Engineering of Domain-Specific Metamorphic Testing Environments
Automated Engineering of Domain-Specific Metamorphic Testing EnvironmentsAutomated Engineering of Domain-Specific Metamorphic Testing Environments
Automated Engineering of Domain-Specific Metamorphic Testing Environments
Pablo G¨®mez Abajo
?
APAC Solutions Challenge Info Session.pdf
APAC Solutions Challenge Info Session.pdfAPAC Solutions Challenge Info Session.pdf
APAC Solutions Challenge Info Session.pdf
GDG on Campus Monash
?
HHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptx
HHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptxHHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptx
HHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptx
HampshireHUG
?
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025
Sugarlab AI
?
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
DianaGray10
?
Building High-Impact Teams Beyond the Product Triad.pdf
Building High-Impact Teams Beyond the Product Triad.pdfBuilding High-Impact Teams Beyond the Product Triad.pdf
Building High-Impact Teams Beyond the Product Triad.pdf
Rafael Burity
?
CIOs Speak Out - A Research Series by Jasper Colin
CIOs Speak Out - A Research Series by Jasper ColinCIOs Speak Out - A Research Series by Jasper Colin
CIOs Speak Out - A Research Series by Jasper Colin
Jasper Colin
?
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-World
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-WorldAll-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-World
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-World
Safe Software
?
Scalable Multi-Agent AI with AutoGen by Udai
Scalable Multi-Agent AI with AutoGen by UdaiScalable Multi-Agent AI with AutoGen by Udai
Scalable Multi-Agent AI with AutoGen by Udai
Udaiappa Ramachandran
?
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
DOCOMO Innovations, Inc.
?
Packaging your App for AppExchange ¨C Managed Vs Unmanaged.pptx
Packaging your App for AppExchange ¨C Managed Vs Unmanaged.pptxPackaging your App for AppExchange ¨C Managed Vs Unmanaged.pptx
Packaging your App for AppExchange ¨C Managed Vs Unmanaged.pptx
mohayyudin7826
?
Rens van de Schoot - Mensen, machines en de zoektocht naar het laatste releva...
Rens van de Schoot - Mensen, machines en de zoektocht naar het laatste releva...Rens van de Schoot - Mensen, machines en de zoektocht naar het laatste releva...
Rens van de Schoot - Mensen, machines en de zoektocht naar het laatste releva...
voginip
?
How to Consistently Make $5,000+ with DeepSmartX
How to Consistently Make $5,000+ with DeepSmartXHow to Consistently Make $5,000+ with DeepSmartX
How to Consistently Make $5,000+ with DeepSmartX
SOFTTECHHUB
?
The Future of Materials: Transitioning from Silicon to Alternative Metals
The Future of Materials: Transitioning from Silicon to Alternative MetalsThe Future of Materials: Transitioning from Silicon to Alternative Metals
The Future of Materials: Transitioning from Silicon to Alternative Metals
anupriti
?
Innovative Web Design | Malachite Technologies
Innovative Web Design | Malachite TechnologiesInnovative Web Design | Malachite Technologies
Innovative Web Design | Malachite Technologies
malachitetechnologie1
?

lisps - A Lisp Interpreter written in Postscript

  • 1. LISPS by Alex & Gabriel
  • 2. A Lisp Interpreter in Postscript ¡ñ Scheme dialect based on Peter Norvig's lispy (lisp interpreter in python) http://norvig.com/lispy.html ¡ñ Scheme dialect ¡ð variables var ¡ð conditional (if test conseq alt) ¡ð definition / assignment (define var value) ¡ð procedure (lambda (var...) exp) ¡ð sequencing (begin exp...) ¡ð procedure call (procedure exp...)
  • 3. Good use of Concepts ¡ñ Parser ¡ð List with arbitrary length /pdict_default << 40 { count 0 eq { mark } { isMark not { mark } if } ifelse mark } % '(' 41 { isMark { pop } { genStr transit } ifelse eval mark } % ')' 32 { isMark not { genStr transit mark } if } % ' ' >> def readline { dup pdict exch known % is current character in dict { pdict exch get exec } % execute mapped code if } forall % for all characters in readline
  • 4. Good use of Concepts ¡ñ Dictionaries / Parser ¡ð state change with dictionaries /pdict pdict_default def /pdict_states << (lambda) { /pdict pdict_lambda def mark } (quote) { /pdict pdict_quote def } >> def /pdict_lambda << 40 { } % '(' do not delete 41 { isMark { pop } { genStr } ifelse ] mark /pdict pdict_default def } % ')' 32 { isMark not { genStr mark } if } % ' ' >> def
  • 5. Good use of Concepts ¡ñ eval ¡ð reorder with stack /eval % op p1..pn - { p1..pn { op } exec } { counttomark -1 roll dup dictionary exch known % test if command is known { dictionary exch get exec } { { call_fun } } ifelse 0 ] cvx dup dup length 1 sub {exec} putinterval } def
  • 6. Good use of Concepts ¡ñ Dictionaries ¡ð map for variables ¡ð bind Scheme commands to PostScript words /dictionary << ... (if) {{myif}} (quote) {{quote}} (define) {{mydef}} (set!) {{myset}} (lambda) {lambda} (begin) { prebegin {mybegin}} (equal?) {{eq}} (eq?) {{eq}} (length) {{getVal length}} (cons) {{cons}} (car) {{getVal 0 get}} (cdr) {{cdr}} (append) {{append}} (list) { list } (list?) {{isList}} (null?) {{null}} >> def
  • 7. Good use of Concepts ¡ñ Lists ¡ð example: Scheme command begin (begin) {prebegin {mybegin}} /prebegin { ] mark exch % make an array of all parameters begin will get and recreate the used mark for parser } def /mybegin { mark exch % set mark where this command's parameter begins { getVal } forall % evaluate each subexpression in right order ] dup length 1 sub get % make array of all outputs and get last one } def
  • 8. Good use of Concepts ¡ñ lambda ¡ð code Injection /lambda { 12 array dup 0 % workaround { null % function that is executed null % array of par_names isCall 3 array dup 0 { set_pars getVal clearpars } putinterval cvx { exch lambda append_par_arr } ifelse } putinterval cvx dup 1 5 -1 roll put dup 0 4 -1 roll put } def