source: project/wiki/chicken-for-ruby-programmers @ 8584

Last change on this file since 8584 was 8584, checked in by svnwiki, 12 years ago

Changes applied for John Cowan (74.68.123.175) through svnwiki:

Expanded list and description of core Scheme syntax

File size: 1.9 KB
Line 
1== Overview
2=== Scheme and Ruby are similar
3* Ruby shares history with Scheme
4** Names: map, Proc(cedures), nil
5** bang! methods/procedures
6** Lexical scope => closures a.k.a. blocks
7** continuations
8** runtime evaluation
9* garbage collected
10* interpreted
11* Purity of design
12=== Scheme and Ruby are different
13* Syntax
14* Can be compiled as well
15* Not object oriented (by default)
16
17== Scheme Basics
18* Scheme has very simple syntax: (procedure arg1 arg2 arg3 ...)
19* There are a few basic special forms to which everything else can be reduced:
20** (if predicate consequent alternate) - basic conditional
21** (lambda var-list expression...) - basic function
22** (set! var value) - assignment
23** (quote anything) - symbol or list constants
24** (define var value) - define a variable
25** (define (name var-list) expression...) - define a variable whose value is a function
26** (define-macro var expression ...) - define a metaprogram
27
28(let ...)
29(letrec ...)
30
31Note: 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.
32== Equivalents from Ruby
33* Array => List/Vector
34
35Also multi-dimensional via SRFI-25, SRFI-47, & SRFI-63 (47 & 63 covered by the 'array-lib" egg).
36
37* Hash => Hash Table
38* Regex => Regex
39* Blocks => Procedures
40* Macros (e.g. acts_as_foo) => Macros
41
42Note that Chicken has only '(define-macro ...)' built-in. The "syntax-rules" system is an egg - the "syntax-case" egg.
43
44* Objects => Numerous object systems
45
46TinyCLOS is probably the best supported by Chicken.
47== Installation & Libraries
48* Basic install guidelines
49* Gems => Eggs
50
51== Getting things Done
52* Shell scripts
53* Web programming
54* Databases
55* GUI Apps
56* Compiling
57* FFI
58
59== Pick Your Style
60* Imperative
61* OOP
62* Functional
63* Stack
64* Actor
65* DSLs and Interpreters
66** Metaprogramming
67
Note: See TracBrowser for help on using the repository browser.