This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> (factorial 4000000) | |
exception error: system_limit | |
in (: erlang | |
* | |
3229797 | |
30123180888527072598754061749733156956836010853066267762188108601162877 | |
501605950711425018360722033156484485761208096373181054336452668279306575186488 | |
625487378757417504192553057885369932190386049370641878631432583447644047021486 | |
245708528594358523103979850867383263694029300939124590581455105879597555548321 | |
332105886291655143516998679067067107752904759587500859444578397785006406762423 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Released Features | |
* Maps in LFE. | |
* A new (run ...) REPL command run running LFE shell commands. | |
* Now possible to define functions and macros in the REPL. | |
* Strings no longer need to be quoted. | |
* LFE now has Common Lisp macros (prog1 ...) and (prog2 ...). | |
* (mod:func ...) syntax now supported. | |
* New (fields-name) macro for easier usage of Mnesia from LFE. | |
* #| ... |# Common Lisp-style multiline comments now supported. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# update rebar.config to include Elixir | |
$ make get-deps | |
$ make compile | |
$ lfetool repl lfe -pa ./deps/elixir/lib/elixir/ebin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun routes | |
"Routes for the Volvoshop REST API." | |
;; /order | |
(((list "order") method arg-data) | |
(order-api method arg-data)) | |
;; /order/:id | |
(((list "order" order-id) method arg-data) | |
(order-api method order-id arg-data)) | |
;; /orders | |
(((list "orders") method arg-data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lfetool2 commands | |
commands - List all the top-level commands available to lfetool. | |
extract - lfetool is no longer compressed; this is a no-op (included for | |
backwards compatibility only). | |
help - Get the general help for lfetool; if passed a plugin name as | |
an argument, display the help for that plugin. | |
info - Get information of the type indicated by the passed argument. | |
install - Install LFE by default; if passed an argument, in stall the | |
indicated software. | |
repl - By default, start an LFE REPL with access to all the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> (defun int-exp (a b) | |
(trunc (math:pow a b))) | |
int-exp | |
> (set lfe (int-exp 2 0)) | |
1 | |
> (set hy (int-exp 2 5)) | |
32 | |
> (set clojure (int-exp 2 6)) | |
64 | |
> (bxor clojure (bxor lfe hy)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pulling lfe from {git,"git://github.com/rvirding/lfe.git","develop"} | |
Cloning into 'lfe'... | |
Pulling 'lfe-utils' from {git,"https://github.com/lfe/lfe-utils.git","master"} | |
Cloning into 'lfe-utils'... | |
Pulling lfeunit from {git,"git://github.com/lfe/lfeunit.git","master"} | |
Cloning into 'lfeunit'... | |
Pulling lfest from {git,"git://github.com/lfex/lfest.git","master"} | |
Cloning into 'lfest'... | |
Pulling yaws from {git,"git://github.com/klacke/yaws.git","master"} | |
Cloning into 'yaws'... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from example.bottle.bttl import Bottle | |
app = Bottle() | |
@app.get('/') | |
def index(): | |
return "Hello, World!" | |
@app.get('/orders') | |
def get_orders(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone git@github.com:oubiwann/erlport-demo.git | |
$ cd erlport-demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;; From the Clojure Cookbook | |
;;;; by Luke VanderHart and Ryan Neufeld | |
;; The easiest way to implement runtime polymorphism is via hand-rolled, | |
;; map-based dispatch using functions like cond or condp: | |
(defn area | |
"Calculate the area of a shape" | |
[shape] | |
(condp = (:type shape) |