Navigation
index
next
|
The Adventures of a Pythonista in Schemeland v0.1 documentation
»
The Adventures of a Pythonista in Schemeland
¶
Contents:
A bit of history
My target
A bit of history: Fortran and Lisp
The algorithmic language Scheme
About Scheme implementations
About Scheme implementations
About the library problem
Additional difficulties
Of parentheses and indentation
Of parens and indentation
About the prefix syntax
Scheme bibliography (and a first program)
Scheme resources for beginners
A simple Scheme program
About tail call optimization (and the module system)
There are no
for
loops in Scheme
There is no portable module system
A simple benchmark
The danger of benchmarks
Beware of wasted cycles
Beware of cheats
Beware of naive optimization
Recursion vs iteration
Symbols and lists
Symbols
Lists
Some example
Quoting and quasi-quoting
Quoting
Quasi-quoting
Programs writing programs
Appendix: solution of the exercises
Introduction to (sweet-)macros
A minimal introduction to Scheme macros
Which macrology should I teach?
Enter sweet-macros
An example:
multi-define
Features of (sweet-)macros
syntax-match
and introspection features of sweet-macros
A couple of common mistakes
Guarded patterns
Literal identifiers
The multiple evaluation problem (and easy-test)
The problem of multiple evaluation
Taking advantage of multiple evaluation
A micro-framework for unit tests
Are macros really useful?
Are macros “just syntactic sugar”?
About the usefulness of macros for application programmers
Appendix: a Pythonic
for
loop
Micro-introduction to functional programming
A minimal introduction to functional programming
Functional data structures: pairs and lists
Functional update
Currying, partial application, and fold
Higher order functions and curried functions
Partial application: cut and cute
fold-left and fold-right
List destructuring
About pattern matching
A list destructuring binding form (let+)
Multiple values (and opt-lambda)
list destructuring versus let-values
Variadic functions from unary functions
Further examples of destructuring: opt-lambda
List comprehension
The APS library
Implementing list comprehension
A tricky point
Streams
The eight queens puzzle
Iterators and streams
Lazyness is a virtue
The R6RS module system
Modules are not first class objects
Compiling Scheme modules vs compiling Python modules
Compiling is not the same than executing
The compilation and evaluation strategy of Scheme programs
Interpreter semantics vs compiler semantics
Macros and helper functions
A note about incremental compilers and interpreters
Discussion
The different meanings of phase separation
Compile-time, run-time and optimization-time
Strong vs weak phase separation
A note about politics
The Dark Tower of Meta-levels
An easy-looking macro with a deep portability issue
Negative meta-levels
Meta-levels greater than one
Discussion
Separate compilation and import semantics
The mysterious import semantics
More implementation-dependent details
Mutating variables across modules
Mutating internal variables
Mutating variables across phases
Cross-phase side effects and separate compilation
Conclusion
Back to macros
Writing your own programming language
Recursive macros with accumulators
A trick to avoid auxiliary macros
Macros taking macros as arguments
Scheme as an unfinished language
Two second order macros to reduce parentheses
The case for parentheses
Syntax objects
What
syntax-match
really is
What macros really are
A nicer syntax for association lists
Hygienic macros
syntax-match
vs
syntax-rules
syntax-match
vs
syntax-case
syntax-match
versus
define-macro
The hygiene problem
Breaking hygiene
datum->syntax
revisited
Playing with the lexical context
Hygienic vs non-hygienic macro systems
Comparing identifiers
symbol-identifier=?
bound-identifier=?
free-identifier=?
Literal identifiers and auxiliary syntax
Indices and tables
¶
Index
Search Page
Table Of Contents
The Adventures of a Pythonista in Schemeland
Indices and tables
Next topic
A bit of history
This Page
Show Source
Quick search
Navigation
index
next
|
The Adventures of a Pythonista in Schemeland v0.1 documentation
»