You are looking at historical revision 8584 of this page. It may differ significantly from its current revision.
Overview
Scheme and Ruby are similar
- Ruby shares history with Scheme
- Names: map, Proc(cedures), nil
- bang! methods/procedures
- Lexical scope => closures a.k.a. blocks
- continuations
- runtime evaluation
- garbage collected
- interpreted
- Purity of design
Scheme and Ruby are different
- Syntax
- Can be compiled as well
- Not object oriented (by default)
Scheme Basics
- Scheme has very simple syntax: (procedure arg1 arg2 arg3 ...)
- There are a few basic special forms to which everything else can be reduced:
- (if predicate consequent alternate) - basic conditional
- (lambda var-list expression...) - basic function
- (set! var value) - assignment
- (quote anything) - symbol or list constants
- (define var value) - define a variable
- (define (name var-list) expression...) - define a variable whose value is a function
- (define-macro var expression ...) - define a metaprogram
(let ...) (letrec ...)
Note: define is technically not primitive in Chicken, because you can set! any variable in Chicken whether it's been defined or not. However, it is best practice to define all variables, and some Schemes enforce this rule.
Equivalents from Ruby
- Array => List/Vector
Also multi-dimensional via SRFI-25, SRFI-47, & SRFI-63 (47 & 63 covered by the 'array-lib" egg).
- Hash => Hash Table
- Regex => Regex
- Blocks => Procedures
- Macros (e.g. acts_as_foo) => Macros
Note that Chicken has only '(define-macro ...)' built-in. The "syntax-rules" system is an egg - the "syntax-case" egg.
- Objects => Numerous object systems
TinyCLOS is probably the best supported by Chicken.
Installation & Libraries
- Basic install guidelines
- Gems => Eggs
Getting things Done
- Shell scripts
- Web programming
- Databases
- GUI Apps
- Compiling
- FFI
Pick Your Style
- Imperative
- OOP
- Functional
- Stack
- Actor
- DSLs and Interpreters
- Metaprogramming