Update readme
This commit is contained in:
22
README.md
22
README.md
@@ -24,7 +24,11 @@ pipple>
|
|||||||
|
|
||||||
Pipple code you write will be run now. Try something like `(print "Hello, World!")`. See what happens!
|
Pipple code you write will be run now. Try something like `(print "Hello, World!")`. See what happens!
|
||||||
|
|
||||||
If you'd like to use Pipple with a file, just add the filename after the executable path.
|
If you'd like to use Pipple with a file, just add the filename after the executable path, like `pipple path/to/code.ppl`
|
||||||
|
|
||||||
|
Pipple also has an experimental transpiler, which will turn your Pipple code into C++. To use, run `pipple -c path/to/code.ppl`. This will print code to the console.
|
||||||
|
|
||||||
|
To quickly compile Pipple code, try `pipple -c path/to/code.ppl | g++ -xc++ - -o exename`, where `exename` is the name of the executable to output to.
|
||||||
|
|
||||||
## Syntax
|
## Syntax
|
||||||
|
|
||||||
@@ -40,6 +44,12 @@ Pipple's syntax looks like most other Lisps. You enclose your statements in `(`
|
|||||||
|
|
||||||
### Setting and Changing Variables
|
### Setting and Changing Variables
|
||||||
|
|
||||||
|
`let` initializes a variable for the first time.
|
||||||
|
|
||||||
|
`set` changes that variable to something else.
|
||||||
|
|
||||||
|
Note: `set` is currently unsupported by the Pipple transpiler.
|
||||||
|
|
||||||
```
|
```
|
||||||
(let x 3.141)
|
(let x 3.141)
|
||||||
(print x)
|
(print x)
|
||||||
@@ -51,6 +61,8 @@ Pipple's syntax looks like most other Lisps. You enclose your statements in `(`
|
|||||||
|
|
||||||
Remember: Polish notation is the key!
|
Remember: Polish notation is the key!
|
||||||
|
|
||||||
|
Note: All math is currently unsupported by the Pipple transpiler.
|
||||||
|
|
||||||
```
|
```
|
||||||
(let x (+ 3 4))
|
(let x (+ 3 4))
|
||||||
(print x)
|
(print x)
|
||||||
@@ -67,6 +79,8 @@ Remember: Polish notation is the key!
|
|||||||
|
|
||||||
In Pipple, `nil` is the only non-truthy value. Every non-`nil` value is truthy.
|
In Pipple, `nil` is the only non-truthy value. Every non-`nil` value is truthy.
|
||||||
|
|
||||||
|
Note: All conditionals are currently unsupported by the Pipple transpiler.
|
||||||
|
|
||||||
```
|
```
|
||||||
(let x 0)
|
(let x 0)
|
||||||
(if (== x 0)
|
(if (== x 0)
|
||||||
@@ -84,6 +98,8 @@ In Pipple, `nil` is the only non-truthy value. Every non-`nil` value is truthy.
|
|||||||
|
|
||||||
### User console input
|
### User console input
|
||||||
|
|
||||||
|
Note: `input` is currently unsupported by the Pipple transpiler.
|
||||||
|
|
||||||
```
|
```
|
||||||
(let x (input))
|
(let x (input))
|
||||||
(print "You said" x)
|
(print "You said" x)
|
||||||
@@ -91,6 +107,8 @@ In Pipple, `nil` is the only non-truthy value. Every non-`nil` value is truthy.
|
|||||||
|
|
||||||
### Lists
|
### Lists
|
||||||
|
|
||||||
|
Note: Lists are currently unsupported by the Pipple transpiler.
|
||||||
|
|
||||||
```
|
```
|
||||||
(list item1 item2 item3)
|
(list item1 item2 item3)
|
||||||
(list "hi there" 32 nil)
|
(list "hi there" 32 nil)
|
||||||
@@ -117,4 +135,4 @@ Valid types in Pipple are:
|
|||||||
* int
|
* int
|
||||||
* double
|
* double
|
||||||
* string
|
* string
|
||||||
* list
|
* list (Currently unsupported by the Pipple transpiler)
|
||||||
|
|||||||
Reference in New Issue
Block a user