Fichas
Scheme
Fichas del conjunto (17)
- 1Primitive Functions: Arithmetic+, -, *, /, remainder, sqrt
e.g., (+ 5 2) yields 7
(- 9 2 1) yields 6 - 2QUOTEtakes one parameter; returns the parameter without evaluation.
can be abbreviated with the apostrophe prefix operator. - 3CARtakes a list parameter; returns the first element of that list.
e.g., (CAR '(A B C)) yields A - 4CDRtakes a list parameter; returns the list without its first element.
e.g., (CDR '(A B C)) yields (B C) - 5CONStakes two parameters, the first of which can be either an atom or a list and the second of which is a list; returns a new list that is concatenation
e.g., (CONS 'A '(B C)) returns (A B C) - 6LISTtakes any number of parameters; returns a list with the parameters as elements.
e.g. (LIST 'a 'b 'c ) returns (a b c) - 7EQ?takes two symbolic atoms as parameters; it returns #T if both parameters are atoms and the two are the same.
EQ? does not work for numeric atoms. - 8EQV?works on both numeric and symbolic atoms.
- 9LIST?takes one parameter; it returns #T if the parameter is a list; otherwise #F.
- 10NULL?takes one parameter; it returns #T if the parameter is the empty list; otherwise #F.
- 11Numeric Predicate Functions=, <>, >, <, >=, <=, EVEN?, ODD?, ZERO?, NEGATIVE?
- 12Read input function(read)
- 13output functions(DISPLAY expression)
(NEWLINE) prints a new line - 14Lambda ExpressionLambda expressions describe nameless
functions.
e.g., (LAMBDA (x) (* x x x) - 15DEFINEAllows you to bind a name to an entity:
1. To bind a symbol to an expression
2. To bind names to lambda expressions - 16CONDmultiple selection
The predicates are evaluated in order from the first until one evaluates to #T. - 17—
Información
- Descripción
- Fichas sobre Scheme, creado por M KB el 19/04/2018.
- Creado por
- M KB
- Visitas
- 2
- Valoración