Language Reference Scheme 48🔗
Note: This reference is to have a complete overview of Scheme 48 it’s base types, functionality
and the different API’s
Scheme48 homepage / sources, documentation, links.
#lang scribble/doc
1 Bindings Examples🔗
Here we define the potential environment operations for bindings:
Have a look how such functionality may be defined
(binding id value) → function?
|
| id : string? |
| value : any?/c |
This function takes a id as first parameter and any value function or another binding as second parameter
and returns a function containing the binding
Example:
This function takes a frame and a new binding and adds the binding to the frame newly created
and given back so the binding is part of this frame which normaly is the actual environment level
Example:
(environment) → function?
|
This function takes no arguments it is the function to return a function representing the quasi singleton
of an environment which holds the frames and inside the frame the stack and the bindings which are newly
created entering a new block and the existing block is pushed back after leaving the block the
actual environent is thrown away and the last environment (frame) is popped from stack
Example:
This example is not complete but you can see a bit how bindings frames and different levels of environments can be handled if you
are interested to learn more about this mechanismn you can read for example the articles of Mr. Landine about the SECD machine concept
#lang scribble/doc
2 The Datatypes - primitives / base types🔗
3 The Datatypes - functions🔗
The basic datatypes like Integer , Boolean, Long, Float Double and the base functions
This function takes a value as parameter and reverts the case of #t to #f
This function takes a first value x as first parameter and a second value x and compares them for equality
This function takes a first value x as first parameter and a second value x and compares them for equality
This function takes a first value x as first parameter and a second value x and compares them for equality
This function takes a first value first as first parameter and a second or 0..n value(s) rest
And here the highest value is returned
This function takes a first value first as first parameter and a second or 0..n value(s) rest
And here the lowest value is returned
This function takes a number and returns the absolute which is than positive
This function takes a nomber and checks if it is zero
This function takes a nomber and checks if it is positive
This function takes a nomber and checks if it is negative
This function takes a nomber and checks if it is even
This function takes a nomber and checks if it is odd
4 The Datatypes - Pairs/Lists 🔗
takes the first element of a list from start of the list
takes the rest element(s) of a list all elements after the first element
4.1 Pairs🔗
constructs a pair out of two given elements to get a object
which is a
pair? as well as a
list?Tests if the element is a pair
Examples:
(pair? (cons 5 6)) -> #t (pair? (list 5 6)) -> #t (pair? (list 5)) -> #f (pair? '(5 6)) -> #t (pair? '(5)) -> #f (pair? '()) -> #f (pair? 5) -> #f
4.2 Lists🔗
Here are some abbreviations which can be useful:
checks if the list is empty ’()
creates a list
the effective length of a list (element count)
append lists to a list and return the result
reverts the order of the elements in a list
returns the tailing list of the list up from index
returns the element at index
Locates the first element of the list that is equal to v according to
equal?.
If such an element exists, the tail of lst starting
with that element is returned. Otherwise, the result is
#f.
Locates the first pair of the list where the key is
equal?
to v and returns it if no match is found it returns
#fAsk if thing is a list
4.3 Characters🔗
Look if first char is smaller than second char
Look if first char is greater than second char
Look if first char is smaller or equal second char
Look if first char is greater or equal second char
4.4 Strings🔗
define a string out of strings
The substring of str starting with start offset and ending end offset
Concat one or more strings to one string
The length of arg
The string reference of str at the index position index
the return is the char at that position
The string arg is converted to a list of chars
The list of chars arg is converted to a string
The string v is filled with the char x
Ask if the string
str1 is case sensitive equal to
str2
return
true if it is or
false if not
Ask if the string
str1 is case sensitive smaller than or equal to
str2
return
true if it is or
false if not
Ask if the string
str1 is case sensitive greater than or equal to
str2
return
true if it is or
false if not
Ask if the string
str1 is case sensitive greater than
str2
return
true if it is or
false if not
Ask if the string
str1 is case sensitive smaller than
str2
return
true if it is or
false if not
Ask if the string
str1 is case insensitive equal to
str2
return
true if it is or
false if not
Ask if the string
str1 is case insensitive greater than or equal to
str2
return
true if it is or
false if not
Ask if the string
str1 is case insensitive smaller than or equal to
str2
return
true if it is or
false if not
Ask if the string
str1 is case insensitive smaller than
str2
return
true if it is or
false if not
Ask if the string
str1 is case insensitive greater than
str2
return
true if it is or
false if not
#lang scribble/doc
#lang scribble/doc
4.5 Vectors🔗