Website

Check-in [97867465fd]
Login
Overview
Comment:Replace all occurences of 'Play' with 'Stabel' in the playground.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 97867465fda857c19a2c818281e36cdbac6a9716a58c7c7d6746560d0bf0d654
User & Date: robin.hansen on 2021-06-08 13:04:55
Other Links: manifest | tags
Context
2021-06-08
13:12
Added sentance about concatinative programming. check-in: 85c613d390 user: robin.hansen tags: trunk
13:04
Replace all occurences of 'Play' with 'Stabel' in the playground. check-in: 97867465fd user: robin.hansen tags: trunk
12:59
Changed wording on the landing page. Fixes [818216465d]. check-in: 4c26e5b198 user: robin.hansen tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified src/Lesson01.elm from [1a1cfdb705] to [92c3cb2380].

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
..
30
31
32
33
34
35
36
37
38
    }


content : String
content =
    """
    # Welcome to the playground
    # Here you can learn the Play language by reading and toying around with examples.
    # You can find more examples in the dropdown above.

    # A '#' character marks the beginning of a line comment.
    # Comments are ignored by the compiler, and serves the purpose of making things clearer for a human.
    
    # Below you'll find a simple word definition.
    # In other programming languages, this will usually be called a function definition.
................................................................................
    : 5         # 3


    # 1. We begin a new word definition, and this word will be called main.
    # 2. 'main' is an entry point, this is called when your program starts up.
    # 3. A single ':' without any prefix marks the definition of the word. In this word, we're simply returning the number 5 (the last element in a definition is its return value).

    # Hit the 'run' button above to execute this Play program.
    """







|







 







|

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
..
30
31
32
33
34
35
36
37
38
    }


content : String
content =
    """
    # Welcome to the playground
    # Here you can learn the Stabel language by reading and toying around with examples.
    # You can find more examples in the dropdown above.

    # A '#' character marks the beginning of a line comment.
    # Comments are ignored by the compiler, and serves the purpose of making things clearer for a human.
    
    # Below you'll find a simple word definition.
    # In other programming languages, this will usually be called a function definition.
................................................................................
    : 5         # 3


    # 1. We begin a new word definition, and this word will be called main.
    # 2. 'main' is an entry point, this is called when your program starts up.
    # 3. A single ':' without any prefix marks the definition of the word. In this word, we're simply returning the number 5 (the last element in a definition is its return value).

    # Hit the 'run' button above to execute this Stabel program.
    """

Modified src/Lesson02.elm from [b3cb2b9f78] to [0441412e0f].

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
    # In the last example we saw that the last element in a word definition, was returned.
    # In fact, words can have multiple return values:

    def: four-and-five
    : 4 5

    # How does this work?
    # The first thing to understand is that Play is stack oriented. 
    # What really happens in the word definition above is that, when executed, the numbers 4 and 5 will be put on a stack.

    # What happens when a word is placed on the stack? It executes!

    def: main
    entry: true
    : four-and-five +







|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
    # In the last example we saw that the last element in a word definition, was returned.
    # In fact, words can have multiple return values:

    def: four-and-five
    : 4 5

    # How does this work?
    # The first thing to understand is that Stabel is stack oriented. 
    # What really happens in the word definition above is that, when executed, the numbers 4 and 5 will be put on a stack.

    # What happens when a word is placed on the stack? It executes!

    def: main
    entry: true
    : four-and-five +

Modified src/Lesson03.elm from [35a77b6d6c] to [ea712cc430].

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
    }


content : String
content =
    """
    # Sometimes it can be nice to re-arrange values on the stack. 
    # Play has some built in words for that purpose.

    # 'dup' let's you duplicate a value

    def: square
    : dup *

    # 'swap' switches the positions of two values







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
    }


content : String
content =
    """
    # Sometimes it can be nice to re-arrange values on the stack. 
    # Stabel has some built in words for that purpose.

    # 'dup' let's you duplicate a value

    def: square
    : dup *

    # 'swap' switches the positions of two values

Modified src/Lesson04.elm from [e29abb4f77] to [37cbbfd48f].

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
    , content = String.trim <| String.unindent content
    }


content : String
content =
    """
    # Play is statically typed. 
    # In most cases, Play is smart enough to infer the types.
    # The word definitions in the previous example are shown here with type annotations.

    def: square
    type: Int -- Int
    : dup *

    def: drop-first







|
|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
    , content = String.trim <| String.unindent content
    }


content : String
content =
    """
    # Stabel is statically typed. 
    # In most cases, Stabel is smart enough to infer the types.
    # The word definitions in the previous example are shown here with type annotations.

    def: square
    type: Int -- Int
    : dup *

    def: drop-first

Modified src/Lesson05.elm from [715d3162cd] to [ef2b7c97d5].

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
    , content = String.trim <| String.unindent content
    }


content : String
content =
    """
    # Play allows you to define compound structures.

    deftype: Coordinate
    : x Int
    : y Int

    # This will define a 'Coordinate' which has two members, x and y, which are integers.

    # Play will also generate some words for you to be able to read and modify this structure.
    # '>Coordinate' is a word that requires two Ints to be on the stack, and will create a Coordinate with those numbers as x and y, respectively.
    # '>x' and '>y' requires an Int and a Coordinate to be on the stack, and sets the x/y member to the provided Int.
    # 'x>' and 'y>' will return the x/y value of a Coordinate, which must be on the stack.

    # The '>' character can be read as 'into'. 
    # '>x' is then read as 'into x' and 'x>' is read as 'x into'. 
    # Either you're reading from the stack and into x, or from x into the stack.







|







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
    , content = String.trim <| String.unindent content
    }


content : String
content =
    """
    # Stabel allows you to define compound structures.

    deftype: Coordinate
    : x Int
    : y Int

    # This will define a 'Coordinate' which has two members, x and y, which are integers.

    # Stabel will also generate some words for you to be able to read and modify this structure.
    # '>Coordinate' is a word that requires two Ints to be on the stack, and will create a Coordinate with those numbers as x and y, respectively.
    # '>x' and '>y' requires an Int and a Coordinate to be on the stack, and sets the x/y member to the provided Int.
    # 'x>' and 'y>' will return the x/y value of a Coordinate, which must be on the stack.

    # The '>' character can be read as 'into'. 
    # '>x' is then read as 'into x' and 'x>' is read as 'x into'. 
    # Either you're reading from the stack and into x, or from x into the stack.

Modified src/Lesson06.elm from [b06a29eede] to [5638076762].

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    , content = String.trim <| String.unindent content
    }


content : String
content =
    """
    # Play allows you to place word references on the stack, and even construct anonymous words.
    # We call them quotations. Other languages call them anonymous functions.

    # For this example, let's bring back the Coordinate type from the previous example.

    deftype: Coordinate
    : x Int
    : y Int







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    , content = String.trim <| String.unindent content
    }


content : String
content =
    """
    # Stabel allows you to place word references on the stack, and even construct anonymous words.
    # We call them quotations. Other languages call them anonymous functions.

    # For this example, let's bring back the Coordinate type from the previous example.

    deftype: Coordinate
    : x Int
    : y Int

Modified src/Lesson07.elm from [bfb7927262] to [6c07cb562b].

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    , content = String.trim <| String.unindent content
    }


content : String
content =
    """
    # Play supports the concept of a Union type

    defunion: State
    : On
    : Off

    deftype: On
    deftype: Off







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    , content = String.trim <| String.unindent content
    }


content : String
content =
    """
    # Stabel supports the concept of a Union type

    defunion: State
    : On
    : Off

    deftype: On
    deftype: Off