mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-02 12:57:53 +02:00
[whip/en] Fix typos
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
language: whip
|
language: whip
|
||||||
contributors:
|
contributors:
|
||||||
- ["Tenor Biel", "http://github.com/L8D"]
|
- ["Tenor Biel", "http://github.com/L8D"]
|
||||||
|
- ["Saurabh Sandav", "http://github.com/SaurabhSandav"]
|
||||||
author: Tenor Biel
|
author: Tenor Biel
|
||||||
author_url: http://github.com/L8D
|
author_url: http://github.com/L8D
|
||||||
filename: whip.lisp
|
filename: whip.lisp
|
||||||
@@ -93,13 +94,13 @@ null ; used to indicate a deliberate non-value
|
|||||||
undefined ; user to indicate a value that hasn't been set
|
undefined ; user to indicate a value that hasn't been set
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; 2. Vairbles, Lists, and Dicts
|
; 2. Variables, Lists, and Dicts
|
||||||
|
|
||||||
; Variables are declared with the `def` or `let` functions.
|
; Variables are declared with the `def` or `let` functions.
|
||||||
; Variables that haven't been set will be `undefined`.
|
; Variables that haven't been set will be `undefined`.
|
||||||
(def some_var 5)
|
(def some_var 5)
|
||||||
; `def` will keep the variable in the global context.
|
; `def` will keep the variable in the global context.
|
||||||
; `let` will only have the variable inside its context, and has a wierder syntax.
|
; `let` will only have the variable inside its context, and has a weirder syntax.
|
||||||
(let ((a_var 5)) (+ a_var 5)) ; => 10
|
(let ((a_var 5)) (+ a_var 5)) ; => 10
|
||||||
(+ a_var 5) ; = undefined + 5 => undefined
|
(+ a_var 5) ; = undefined + 5 => undefined
|
||||||
|
|
||||||
@@ -163,7 +164,7 @@ undefined ; user to indicate a value that hasn't been set
|
|||||||
|
|
||||||
(my_function 10 10) ; = (+ (+ 10 10) 10) => 30
|
(my_function 10 10) ; = (+ (+ 10 10) 10) => 30
|
||||||
|
|
||||||
; Obiously, all lambdas by definition are anonymous and
|
; Obviously, all lambdas by definition are anonymous and
|
||||||
; technically always used anonymously. Redundancy.
|
; technically always used anonymously. Redundancy.
|
||||||
((lambda (x) x) 10) ; => 10
|
((lambda (x) x) 10) ; => 10
|
||||||
|
|
||||||
@@ -191,7 +192,7 @@ undefined ; user to indicate a value that hasn't been set
|
|||||||
(slice (.. 1 5) 2) ; => (3 4 5)
|
(slice (.. 1 5) 2) ; => (3 4 5)
|
||||||
(\ (.. 0 100) -5) ; => (96 97 98 99 100)
|
(\ (.. 0 100) -5) ; => (96 97 98 99 100)
|
||||||
|
|
||||||
; `append` or `<<` is self expanatory
|
; `append` or `<<` is self explanatory
|
||||||
(append 4 (1 2 3)) ; => (1 2 3 4)
|
(append 4 (1 2 3)) ; => (1 2 3 4)
|
||||||
(<< "bar" ("foo")) ; => ("foo" "bar")
|
(<< "bar" ("foo")) ; => ("foo" "bar")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user