Title: Theory / Unimportant / CS / Programming / LISP / TSPL4
Tags: FromInstruction computer_to_instruction prefix declaration todo_declaration comment syntactical_sugar fromAlgorithm

Name: Revised^foo report
Definition: The report defining version foo of scheme
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1
Context: Scheme

Name: First-class value
Definition: A value which can be stored in a variable, and passed as function argument
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1

Name: data values
Definition: types of things manipulated by the programming language
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1
Context: Programming language
Name2: objects

Name: garbage collector
Definition: A program that periodically recovers the storage used by inaccessible objects.
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1
Context: Programming language

Name: Lexical scope
Definition: A binding is visible only withing the program text that makes up the partical block of code.
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1
Context: Programming language

Question: In scheme, variables' scope is
Answer: lexical
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1

Question: In scheme, keywords' scope is
Answer: lexical
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1

Name: Lexical shadowing
Definition: The fact that, if two variables are introduced with the same name in a block and a sublock, the variable from the sublock is used in the sublock and its subsubblocks
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1
Context: Programming language

Name: A tail call
Definition: A call to a procedure, whose result is immediatly and unconditionnaly returrned
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1
Context: Programming language

Question: Main interest of tail calls
Answer: storage overhead normally associated with recursion is avoided.
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1
Context: Programming language

Name: Continuation
Definition: A procedure that embodies the remainder of a program at a given point in the program
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1
Context: Programming language

Name: Syntactic extension
Definition: writing transformation procedures that determine how each new syntactic form maps to existing syntactic forms
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1
Context: Programming language

Question: Scheme's advantage over arbitrary (old) lisp
Answer: lexical scoping
Page: https://www.scheme.com/tspl4/intro.html
Chapter: 1
Context: Programming language
Answer2: block structure,
Answer3: first-class procedures,
Answer4: the treatment of tail calls as jumps,
Answer5: continuations,
Answer6: lexically scoped syntactic extensions.

Name: Identifiers
Definition: Keywords
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Chapter: 1
Context: Scheme
Definition2: variables
Conjdef: All of
Definition3: symbols

Question: Identifiers delimiters
Answer: whitespace
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Chapter: 1
Context: Scheme
Answer2: comments
Answer3: parentheses
Answer4: brackets
Answer5: string (double) quotes ( " )
Answer6: hash marks( # ).

Question: Symbol which cannot start an identifier
Answer: @, ->
+, - (except if there are no other character)
. (except if the identifier contains only . )
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Chapter: 1
Context: Scheme

Question: Symbol which can be used in identifiers
Answer: letters, digits, and certain special characters, including ?, !, ., +, -, *, /, <, =, >, :, $, %, ^, &, _, ~, and @, as well as a set of additional Unicode characters
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Chapter: 1
Context: Scheme

Question: Is scheme case-sensitive ?
Answer: yes
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Chapter: 1
Context: Scheme

Instruction: () or []
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Language: Lisp
Chapter: 1
Returns: Empty list

Instruction: #(foo_1 ... foo_n)
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Language: Lisp
Chapter: 1
Returns: The vector whose elements are foo_i

Instruction: #vu8(foo_1 ... foo_n)
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Language: Lisp
Chapter: 1
Returns: The bytevector whose elements are foo_i

Instruction: #\a
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Language: Lisp
Chapter: 1
Returns: The character a

Instruction: "foo"
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Language: Lisp
Chapter: 1
Returns: The string whose text is foo

Instruction: foo@bar
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Language: Lisp
Chapter: 1
Returns: the complex number foo e^i bar

Instruction: fooi
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Language: Lisp
Chapter: 1
Returns: The imaginary number foo

Instruction: #f
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Language: Lisp
Chapter: 1
Returns: the false Boolean

Instruction: #t
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Language: Lisp
Chapter: 1
Returns: the true Boolean

Question: falsy values in scheme are
Answer: #f
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Chapter: 1
Context: scheme

Question: truthy values in scheme are
Answer: everything but #f
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Chapter: 1
Context: scheme

Language: scheme
Abbreviation: ; foo
Instruction: #| foo
bar
plop
|#
Other fields (not shown on cards):
Chapter: 1
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1

Instruction: #;(foo)
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Effect: None (it is a local comment)
Language: scheme
Chapter: 1
Name: datum

Name: Predicate
Definition: A procedure returning true or false answer
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Chapter: 1
Section: 2
Context: scheme
Example: eq? zero ?
Denoted by: Name ending by a question mark

Instruction: t?
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Language: scheme
Chapter: 1
Section: 2
Returns: Procedure stating whether the type of the argument is t
Variables: t a type

Instruction: t-foo
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Language: scheme
Chapter: 1
Section: 2
Returns: A procedure, doing foo on elements of type t
Variables: t a type

Instruction: t->t'
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Language: scheme
Chapter: 1
Section: 2
Returns: A procedure converting elements of type t to type t'
Variables: t,t' a type

Definition: A procedure having a side effect
Page: https://www.scheme.com/tspl4/intro.html#./intro:h1
Chapter: 1
Section: 2
Context: scheme
Denoted by: Name ending by an exclamation mark (!)

Name: syntax violation
Definition: a situation in which a program is malformed
Page: https://www.scheme.com/tspl4/intro.html#./intro:h3
Chapter: 1
Section: 3

Name: The Scheme Programming Language
Page: https://www.scheme.com/tspl4/
Abbreviation: TSPL

Name: read-evaluate-print loop
Definition: A program which reads each expression you type at the keyboard, evaluates it, and prints its value.
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2
Abbreviation: REPL

Definition: When you foo is evaluated, the repl prints bar
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2
Context: scheme
Notation: foo￼ bar

Extension: ss
Means: scheme
Other fields (not shown on cards):
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2

Instruction: (load foo)
Page: https://www.scheme.com/tspl4/start.html
Effect: load the content of file foo as if it is were written here
Language: Lisp
Chapter: 2

Name: Exact number
Definition: Number with arbitrary precision
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2

Name: Inexact number
Definition: Number represented in the computer, using IEEE standard floating-point representation
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2

Instruction: (foo_1 foo_2 ... foo_n)
Page: https://www.scheme.com/tspl4/start.html
Effect: Evalute each foo_i.
Applies the result of foo_1 to the arguments which are the results of foo_2 to foo_n
Language: Lisp
Chapter: 2
Assuming: foo_1 is not a syntactic form
Name: procedure application

Instruction: (quote foo)
Page: https://www.scheme.com/tspl4/start.html
Language: Lisp
Chapter: 2
Returns: The object foo as it is, not evaluated
Abbreviation: 'foo

Name: A quoted object
Definition: An object enclosed in a quote expression
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2

Question: What happen when quoting a string
Answer: the exact string, same as unquoted, is returned
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2

Question: What happen when quoting a number
Answer: the exact number, same as unquoted, is returned
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2

Question: How to pronounce cdr
Answer: could-er
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2

Instruction: (car foo)
Page: https://www.scheme.com/tspl4/start.html
Language: Lisp
Chapter: 2
Returns: The first element of pair/list foo

Instruction: (cdr foo)
Page: https://www.scheme.com/tspl4/start.html
Language: Lisp
Chapter: 2
Returns: The second element of pair/tail of the list foo

Name: Consing
Definition: Creating a list from its head and tail
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2

Name: A list
Definition: Either (), or a pair, whose second element is a list.
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2
Context: Scheme

Name: A proper list
Definition: A list such that applying cdr eventually leads to ()
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2
Context: Scheme

Instruction: (foo_1 ... foo_n . bar)
Page: https://www.scheme.com/tspl4/start.html
Language: Scheme
Chapter: 2
Returns: An improper list, (cons foo_1 (cons ... (cons foo_n bar)))

Name: A dotted pair
Definition: A pair whose second element is not a list
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2
Context: Scheme
Denoted by: (foo . bar)

Instruction: (list foo_1 ... foo_n)
Page: https://www.scheme.com/tspl4/start.html
Language: Scheme
Chapter: 2
Returns: The list whose elements are the foo_i

Name: core syntactic form
Definition: The syntactic forms provided directly by Scheme
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2
Section: 3
Context: Scheme
Example: lambda, if, quote

Name: syntactic extension
Definition: The syntactic forms defined using other syntact forms
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2
Section: 3
Context: Scheme
Example: let

Question: The order of evaluation of parameters of a procedure call is
Answer: unspecified
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2
Section: 3
Context: Scheme

Instruction: (let
  ([foo_1 bar1]
    ...
    [foo_n bar_n]
  )
  plop_1
_  ...
  plop_m
)
Page: https://www.scheme.com/tspl4/start.html
Effect: Evaluate each bar_i.
Evaluate plop_1 ... plop_m (in this order) where foo_i is interpreted as the evaluation of bar_i
It is syntactic sugar for
((lambda (foo_1 ... foo_n)
plop_1
_ ...
plop_m)
bar_1 ... bar_n)
Language: Scheme
Chapter: 2
Section: 4, 5

Name: The bound variables
Definition: The foo_i
Page: https://www.scheme.com/tspl4/start.html
Chapter: 2
Section: 4
Variables: (let
(
(foo_1 bar1)
...
(foo_n bar_n)
)
plop_1
_ ...
plop_m
)
Context: Scheme

Instruction: (lambda
foo
_ bar_1
...
bar_n
)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: A procedure, taking an arbitrary number of parameters.
Executing each bar_i (in this order) with foo interpreted as the list of parameters.
Syntactic sugar for
(lambda
( . foo)
_ bar_1
...
bar_n
)
Language: Lisp
Chapter: 2
Section: 5

Instruction: (lambda
  (foo_1 ... foo_n . plop)
_  bar_1
  ...
  bar_n
)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: A procedure, taking at least n parameters.
Executing each bar_i (in this order) with foo_j interpreted as the j-th argument. foo interpreted as the list of arguments after the n-th one.
Language: Lisp
Chapter: 2
Section: 5

Instruction: (lambda
  (foo_1 ... foo_n)
_  bar_1
  ...
  bar_n
)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: A procedure, taking n parameters.
Executing each bar_i (in this order) with foo_j interpreted as the j-th argument
Language: Lisp
Chapter: 2
Section: 5

Name: A free variable of this lambda expression
Definition: A variable, occuring in bar_i and distinct from foo (or their elements, if its a list)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 5
Variables: (lambda
foo
_ bar_1
...
bar_n
)

Name: A Lambda expression
Definition: An expression of the form (lambda foo_1 ... foo_n)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 5
Context: scheme

Instruction: (define foo bar)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Meaning: Evaluate bar.
State that, from now on, foo is a global variable, whose value is now bar
Language: Lisp
Chapter: 2
Section: 6
Identifier: foo
Extra: variable definition

Instruction: (co_1...o_ndr x)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Language: Lisp
Chapter: 2
Section: 6
Returns: (co_1r ... (co_nr x))
Variables: o_1 ... o_n a sequence of a and d

Instruction: (define
  (foo bar_1 ... bar_n)
  miam_1
_  ...,
  miam_m
)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Meaning: Syntactic sugar for
(define foo
(lambda (bar_1 ... bar_n)
miam_1
_ ...
miam_m
)
)
Language: Lisp
Chapter: 2
Section: 6

Instruction: (define
  (foo_ . plop)
  miam_1
_  ...,
  miam_m
)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Meaning: Syntactic sugar for
(define foo
(lambda plop
miam_1
_ ...
miam_m
)
)
Language: Lisp
Chapter: 2
Section: 6

Instruction: (define
  (foo bar_1 ... bar_n . plop)
  miam_1
_  ...
  miam_m
)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Meaning: (define foo
  (lambda (bar_1 ... bar_n . plop)
    miam_1
_    ...
    miam_m
  )
)
Language: Lisp
Chapter: 2
Section: 6

Name: defun
Definition: A definition of the form
(define (function parameters) body)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 6
Etymology: Its the name of the equivalent construction in lips

Question: How are interpreted free variables of lambda expressions ?
Answer: If the variable is locally bound where the lambda expression is defined, it use this bounding.
Otherwise, it uses a global definition for this variable if it exists
Otherwise, an error message occur
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 6

Instruction: (if
foo
bar)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: Evaluates foo.
If it is truthy, evaluates bar
Language: Lisp
Chapter: 2
Section: 7
Returns: if foo holds, bar. Otherwise?
Assuming: value returned is not used

Instruction: (if
foo
bar
plop)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: Evaluates foo.
If it is truthy, evaluates bar
Otherwise, evaluate plop
Language: Lisp
Chapter: 2
Section: 7
Returns: Evaluates foo.
If it is truthy, bar
Otherwise, plop

Instruction: not
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Language: Lisp
Chapter: 2
Section: 7
Returns: procedure returning #t on #f, and #f on every other input

Instruction: (or foo__1 ... foo_n)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: Evaluate the foo_i in this order, until one of them is truthy.
Language: Lisp
Chapter: 2
Section: 7
Returns: The first truthy value.
Otherwise #f

Instruction: (and foo__1 ... foo_n)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Language: Lisp
Chapter: 2
Section: 7
Returns: the first non #f value if any, otherwise #f
If n=0, return #t

Instruction: lisp-cdr
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Language: Lisp
Chapter: 2
Section: 7
Returns: The second element of the pair if a pair
() on ()

Instruction: eqv?
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: Procedure taking two arguments, stating whether they are equivalent
Language: Lisp
Chapter: 2
Section: 7

Instruction: (assertion-violation foo bar buz_1 ... buz_n)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: Raise an exception.
exception in foo: bar buz_1 ... buz_n
Language: Lisp
Chapter: 2
Section: 7

Name: The irritant(s) of this exception
Definition: the buz_i
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 7
Variables: (assertion-violation foo bar buz_1 ... buz_n)

Instruction: (cond
[foo_1 bar_1]
...
[foo_n bar_n])
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: Evaluate the foo_i until one is truthy.
Language: Lisp
Chapter: 2
Section: 7
Returns: The bari associated to this truthy value

Instruction: (cond
[foo_1 bar_1]
...
[foo_n bar_n]
[else plop])
Page: https://www.scheme.com/tspl4/start.html#./start:h0 , 15
Effect: Evaluate the fooi until one is truthy
Language: Lisp
Chapter: 2, 2 little scheme
Section: 7
Returns: the bar_i associated to the first truthy foo_i. Otherwise plop

Name: Recursion
Definition: Application of a procedure from within it
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 8

Name: Recursive procedure
Definition: A procedure that applies itself immediately
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 8

Name: the base case
Definition: The case where the recursive procedure does not call itself
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 8
Context: recursion

Name: the recursion step
Definition: The case where the recursive procedure calls itself
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 8
Context: recursion

Instruction: (trace foo)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Language: chez scheme
Chapter: 2
Section: 8
Returns: Each call to foo is printed, with its list of argument, and return value

Instruction: (map foo bar_1 ... bar_n)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Language: chez scheme
Chapter: 2
Section: 8
Returns: the list, whose i-th element is (foo bar_1j ... bar_nj), where bar_ij is the j-th element of bar_i
Assuming: each bar_i have the same length

Instruction: (set! foo bar)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: Evaluate bar. Set the value of the variable foo to the evaluation of bar.
Language: chez scheme
Chapter: 2
Section: 8
Assuming: foo is a variable, initialized with lambda, let, define,...

Question: Main interest of "set!" in lisp
Answer: To do work, which is not important for the caller of the function, but important for meta purposes.
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 8
Context: Scheme
Answer2: Memoization
Answer3: Mutable data structure (should be avoided)
Example: Counting the number of call to a function.

Question: How to create a variable which can be read, but not assigned.
Answer: Use a method readVar.
Decale it first to return an arbitrary value.
When the variable var is declared, assign readVar to (lambda() var)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 8
Context: Scheme

Name: A thunk
Definition: A zero-argument procedure
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 8
Context: Scheme

Name: A lazy evaluation of a thunk
Definition: On first call to t, evaluate t. Store its value in a variable.
On successive call, return the value stored in the variable.
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Chapter: 2
Section: 8
Variables: t a thunk
Context: Scheme

Page: https://www.scheme.com/tspl4/start.html#./start:h0
Implementation: (define f?
(lambda (t)
(let ([val #f] [flag #f])
(lambda ()
(if (not flag)
(begin (set! val (t))
(set! flag #t)))
val))))
Section: 8
Chapter: 2
Effect: A procedure, taking as input a thunk. Returning an equivalent lazy thunk
Language: Scheme

Instruction: (begin foo_1 ... foo_n)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: Evaluate each foo_i in this order.
Syntactic sugar for
((lambda () foo_1 ... foo_n)) if at least one foo_i is not a definition
Language: Scheme
Chapter: 2
Section: 8
Returns: the value of the evaluation of the last foo_n

Instruction: (display foo)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: Show the value of foo
Language: Scheme
Chapter: 2
Section: 8

Instruction: (set-car! foo bar)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: Set the value of the first element of the pair foo to bar
Language: Scheme
Chapter: 2
Section: 8

Instruction: (set-cdr! foo bar)
Page: https://www.scheme.com/tspl4/start.html#./start:h0
Effect: Set the value of the second element of the pair foo to bar
Language: Scheme
Chapter: 2
Section: 8

Name: formals
Definition: variable
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3
Context: Scheme
Definition2: (variable ... variable)
Conjdef: Either
Definition3: (variable ... variable . variable)

Name: constant
Definition: boolean
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3
Context: Scheme
Definition2: number
Conjdef: Either
Definition3: character
Definition4: string

Name: expression
Definition: constant
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3
Context: Scheme
Definition2: (quote <datum>)
Conjdef: Either
Definition3: (lambda <formals><expr>+)
Definition4: (if <expr><expr><expr>)
Definition5: (set! <var><expr>)
Definition6: <application>

Name: definition
Definition: (begin <definition>*)
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3
Context: Scheme
Definition2: <variable definition>
Conjdef: Either

Name: form
Definition: <definition>
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3
Context: Scheme
Definition2: <expression>
Conjdef: Either

Name: <program>
Definition: <form>*
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3
Context: Scheme

Name: tranformer
Definition: Some syntactic rule introduced with define-syntax
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3
Context: Scheme
Name2: A syntactic transformation procedure

Name: pattern variable
Definition: and identifier, other than _ and ..., not listed as auxiliary keyword
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3
Context: Scheme pattern

Instruction: foo ...
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Language: Scheme
Context: Pattern
Chapter: 3
Returns: An template matching zero or more expressions matching the pattern pat

Name: ellipsis prototype
Definition: A pattern before an ellipsis
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3
Context: Scheme pattern

Instruction: (_ foo_1 ... foo_n)
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Effect: The pattern foo_1 ... foo_n
Language: Scheme
Context: Syntactic extensions
Chapter: 3

Name: Auxiliary keywords
Definition: List of keywords which appear in a pattern and should not be considered as pattern variable
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3

Name: A pattern
Definition: One of the form that can take the input of a syntactic extension
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3
Context: Scheme Syntactic extensions

Name: A prototype
Definition: One of the form that can take the output of a syntactic extension
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3
Context: Scheme Syntactic extensions

Instruction: foo ...
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Language: Scheme
Context: Syntactic prototype
Chapter: 3
Returns: The list of expression matched by foo
Assuming: foo belongs to an expression, followed by a ...

Instruction: foo
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Language: Scheme
Context: Syntactic prototype
Chapter: 3
Returns: The expression matched by foo
Assuming: foo does not belong to an expression, followed by a ...

Instruction: (syntax-rules
  (foo_1 ... foo_n)
  [bar_1 plop_1]
  ...
  [bar_n plop_n]
)
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Language: Scheme Syntactic prototype
Chapter: 3
Returns: A syntactic rule, using foo__i as auxiliary keywords.
If it is applied to arguments matching the pattern bar_j, then it is replaced by plop_j, where each variable of plop___j ocurring in bar_j, is replaced by the part of the argument in the same place.
Each variable introduced in plop_j are replaced by unique new name.
Example: (define-syntax and
(syntax-rules ()
[(_) #t]
[(_ e) e]
[(_ e1 e2 e3 ...)
(if e1 (and e2 e3 ...) #f)]))

Instruction: (letrec
  ([foo_1 bar_1],
    ...,
    [foo_m bar_m]
  )
  plop_1,
_  ...,
_  plop_m
)
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Effect: Similar to
(let
(
[foo_1 bar_1]
...
[foo_m bar_m]
)
plop_1
_ ..
_ plop_m
)
But foo_j is intepreted as bar_j in each bar_i.
Language: Lisp
Chapter: 3
Section: 2
Assuming: No foo_i occurring in some bar_j is required to compute the value bar_j. (i.e. they are enclosed in some lambda expression. Or in some syntactic construct whose expansion use a lambda)

Instruction: (let
  miam
  ([foo_1 bar1],
    ...,
    [foo_m barm]
  )
  plop_1,
  ...,
  plop_n
)
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Effect: Similar to
(let
(
[foo_1 bar_1]
...
[foo_m bar_m]
)
plop_1
_ ..
_ plop_n
)
But in each plop_i, (miam zing_1 ... zing_m) is interpreted as the let itself, where the bar_i became zing_i. that is:
(let
miam
(
[foo_1 zing_1]
...
[foo_m zing_m]
)
plop_1
_ ..
_ plop_n
)
Language: Lisp
Chapter: 3
Section: 2
Assuming: No foo_i occurring in some bar_j is required to compute the value bar_j. (i.e. they are enclosed in some lambda expression. Or in some syntactic construct whose expansion use a lambda)

Name: A continuation
Definition: A state of the running program
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Chapter: 3
Context: Scheme

Instruction: (call/cc
foo)
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Effect: call (foo p) with p a continuation waiting for the return of this expression.
Language: Scheme
Chapter: 3
Returns: If (foo p) calls (p bar) then bar Either, the value of (foo p)
Assuming: foo is a procedure with a single parameter
Example: (define product
(lambda (ls)
(call/cc
(lambda (break)
(let f ([ls ls])
(cond
[(null? ls) 1]
[(= (car ls) 0) (break 0)]
[else (* (car ls) (f (cdr ls)))]))))))
(product '(1 2 3 4 5)) 120
(product '(7 3 8 0 1 9 5)) 0

Instruction: (cont foo)
Page: https://www.scheme.com/tspl4/further.html#./further:h0
Effect: jump to the part of the program where cont was creating, sending it the value foo
Language: Scheme
Chapter: 3
Returns: None
Variables: cont a continuation