diff options
-rw-r--r-- | elisp.html.markdown | 4 | ||||
-rw-r--r-- | erlang.html.markdown | 2 | ||||
-rw-r--r-- | javascript.html.markdown | 3 | ||||
-rw-r--r-- | lua.html.markdown | 2 | ||||
-rw-r--r-- | racket.html.markdown | 15 |
5 files changed, 17 insertions, 9 deletions
diff --git a/elisp.html.markdown b/elisp.html.markdown index 740d44aa..d3910759 100644 --- a/elisp.html.markdown +++ b/elisp.html.markdown @@ -5,7 +5,7 @@ contributors: filename: learn-emacs-lisp.el --- -```elisp +```scheme ;; This gives an introduction to Emacs Lisp in 15 minutes (v0.2d) ;; ;; Author: Bastien / @bzg2 / http://bzg.fr @@ -16,7 +16,7 @@ filename: learn-emacs-lisp.el ;; Then install GNU Emacs 24.3: ;; ;; Debian: apt-get install emacs (or see your distro instructions) -;; MacOSX: http://emacsformacosx.com/emacs-builds/Emacs-24.3-universal-10.6.8.dmg +;; OSX: http://emacsformacosx.com/emacs-builds/Emacs-24.3-universal-10.6.8.dmg ;; Windows: http://ftp.gnu.org/gnu/windows/emacs/emacs-24.3-bin-i386.zip ;; ;; More general information can be found at: diff --git a/erlang.html.markdown b/erlang.html.markdown index 951fdedd..065219ba 100644 --- a/erlang.html.markdown +++ b/erlang.html.markdown @@ -6,7 +6,7 @@ filename: learnerlang.erl --- ```erlang -% Percent sign starts an one-line comment. +% Percent sign starts a one-line comment. %% Two percent characters shall be used to comment functions. diff --git a/javascript.html.markdown b/javascript.html.markdown index cbe82054..9cc7617d 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -427,6 +427,9 @@ more about how to use JavaScript in web pages, start by learning about the [Document Object Model](https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core) +[Javascript Garden](http://bonsaiden.github.io/JavaScript-Garden/) is an in-depth +guide of all the counter-intuitive parts of the language. + In addition to direct contributors to this article, some content is adapted from Louie Dinh's Python tutorial on this site, and the [JS Tutorial](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) diff --git a/lua.html.markdown b/lua.html.markdown index 0ece399f..7325a1cf 100644 --- a/lua.html.markdown +++ b/lua.html.markdown @@ -87,7 +87,7 @@ until num == 0 ---------------------------------------------------- function fib(n) - if n < 2 then return 1 end + if n < 2 then return n end return fib(n - 2) + fib(n - 1) end diff --git a/racket.html.markdown b/racket.html.markdown index b6c1f86b..adacd91d 100644 --- a/racket.html.markdown +++ b/racket.html.markdown @@ -5,6 +5,7 @@ filename: learnracket.rkt contributors: - ["th3rac25", "https://github.com/voila"] - ["Eli Barzilay", "https://github.com/elibarzilay"] + - ["Gustavo Schmidt", "https://github.com/gustavoschmidt"] --- Racket is a general purpose, multi-paradigm programming language in the Lisp/Scheme family. @@ -555,11 +556,15 @@ vec ; => #(1 2 3 4) (set! x y) (set! y tmp))) -(define tmp 1) -(define a 2) -(define b 3) -(swap! a b) -(printf "tmp = ~a; a = ~a; b = ~a\n" tmp a b) ; tmp is unaffected +(define tmp 2) +(define other 3) +(swap! tmp other) +(printf "tmp = ~a; other = ~a\n" tmp other) +;; The variable `tmp` is renamed to `tmp_1` +;; in order to avoid name conflict +;; (let ([tmp_1 tmp]) +;; (set! tmp other) +;; (set! other tmp_1)) ;; But they are still code transformations, for example: (define-syntax-rule (bad-while condition body ...) |