Commit Graph

221 Commits

Author SHA1 Message Date
Jay Hayes
75c54e0585 Remove explanation of tail recursion
Curious readers might look it up, so just mention it in passing and let
them focus on the task at hand: handling multiple messages.
2016-05-04 15:13:49 -05:00
Jay Hayes
4e4e35f575 Remove process about killing others 😆 2016-05-04 15:13:35 -05:00
Jay Hayes
f7cced5913 Replace multiple receives with assert_receives
❤️ #101
2016-05-04 15:08:17 -05:00
Jay Hayes
65b9af48b4 Add example of process as state 2016-05-04 15:07:12 -05:00
Jay Hayes
6126d5a836 Add koan illustrating tail recursion 2016-05-04 15:06:57 -05:00
Jay Hayes
1f24de98f4 Rearrange existing koans to paint a clearer picture 2016-05-04 15:06:39 -05:00
Jay Hayes
322799a655 Remove koans illustrating self-exit
I don't really like these examples, because the process would exit
anyway when the function returns... Also having to sleep is not ideal.
2016-05-04 15:06:12 -05:00
Jay Hayes
cdfca2a24a Extract variable for spawned function 2016-05-04 15:05:47 -05:00
Jay Hayes
92ccbcd68d Tweak descriptions of a couple process koans 2016-05-04 15:05:47 -05:00
Jay Hayes
1f1112c888 Add koan illustrating that a process is referenced by a pid 2016-05-04 15:05:19 -05:00
Uku Taht
bc8f98d5d9 Merge pull request #100 from iamvery/tweak-maps-koan
Replace pipeline with composed function in maps koan
2016-05-04 15:49:05 +01:00
Jay Hayes
e2468b92cc Avoid keys order issue by using Maps.has_key?/2 2016-05-04 09:28:49 -05:00
Jay Hayes
f93e29cc8c Remove "keys and values" example 2016-05-04 09:28:35 -05:00
Uku Taht
48b593be8e Merge pull request #99 from iamvery/tweak-enum-koan
Tweak enum koan
2016-05-04 10:18:08 +01:00
Jay Hayes
c39916df2e Replace pipeline with composed function
At this point, the learner hasn't seen functions, the Enum module, or
the pipe operator, so it feels like a little much to add that here. The
reason it's needed is that the order of keys/1 and values/1 is reverse
of how it's defined. This is due to an implementation detail in Erlang's
maps. We /could/ use this as a learning opportunity rather than sorting
them, but I'm not sure what could be said about that...
2016-05-03 19:31:07 -05:00
Jay Hayes
19998b452c Add another match to illustrate that only the first is found 2016-05-03 19:22:16 -05:00
Jay Hayes
4017cfcd72 Change test data to illustrate that they /all/ must match 2016-05-03 19:21:51 -05:00
Jay Hayes
b184de5817 Remove parens from self
In my experience, the parens in this case are not idiomatic.
2016-05-03 19:11:28 -05:00
Jay Hayes
74b99676e7 Add example of anonymous function as argument 2016-05-03 19:08:51 -05:00
Jay Hayes
a808d275db Reword function pattern matching example 2016-05-03 19:08:51 -05:00
Jay Hayes
8311362f19 Reword function with default arg example 2016-05-03 19:08:51 -05:00
Jay Hayes
64d6e72b46 Add example of matching map with struct 2016-05-03 19:08:51 -05:00
Jay Hayes
8bcd7d2c94 Reword function pattern matching example 2016-05-03 19:08:51 -05:00
Jay Hayes
944f932ec5 Add example of lists not support partial match 2016-05-03 19:08:51 -05:00
Jay Hayes
12ce3ba2d3 Reword maps matching example 2016-05-03 19:08:51 -05:00
Jay Hayes
b577a24753 Extract initial example of binding before showing rebinding 2016-05-03 19:08:51 -05:00
Jay Hayes
4fda4ab9ff Reword pinning example 2016-05-03 19:08:51 -05:00
Jay Hayes
b2458bb472 Consistent one-liner for receive-blocked processes 2016-05-03 08:23:57 -05:00
Jay Hayes
1611483206 Reword some more examples 2016-05-03 08:23:57 -05:00
Jay Hayes
cc47f7c9c6 Simplify cases 2016-05-03 08:23:56 -05:00
Jay Hayes
71dfd882c6 Tweak wording 2016-05-03 08:23:23 -05:00
Jay Hayes
8ea68548fe Simplify example 2016-05-03 08:23:23 -05:00
Jay Hayes
2d7982e9a3 Remove indirection of wait/0 2016-05-03 08:23:23 -05:00
Jay Hayes
b955a4db64 Remove unneeded case 2016-05-03 08:23:23 -05:00
Jay Hayes
6772308e9a Add a little more context to example description 2016-05-03 08:23:23 -05:00
Jay Hayes
dacaf4c0b1 Actually illustrate use of receive function 2016-05-03 08:23:22 -05:00
Jay Hayes
bef1cf5028 Add new test illustrating spawning processes 2016-05-03 08:23:00 -05:00
Alex
b69010d05c Map.fetch! -> Map.fetch
I think is better to continue use safe ```Map.fetch``` until we familiarize users with dangerous function concept.
Not every body comes from ruby background, with knowledge of ```?``` and ```!``` function notations.

test ifx
2016-04-26 21:16:43 +03:00
Uku Taht
30dcdd5efe Move blank in pin operator koan 2016-04-26 13:32:33 +01:00
Uku Taht
353ce95a1a Attempt clarifying the pin operator 2016-04-26 13:03:46 +01:00
Rabea Gleissner
72048db01f Fixes typo 2016-04-26 12:31:45 +01:00
Rabea Gleissner
919b877d51 Makes changing pattern more obvious 2016-04-26 12:24:57 +01:00
Rabea Gleissner
9ec6089bde Add new koan for anonymous functions with pattern matching 2016-04-26 12:07:45 +01:00
Zander Mackie
d1c7a179f6 Struct koans now calls '|' operator by correct name: 'cons' 2016-04-25 17:54:59 -04:00
Felipe Seré
fcb45c78da Merge pull request #78 from iamvery/trailing-commas
Add trailing commas to multi-line lists and maps
2016-04-24 10:44:14 +01:00
fabien townsend
ca1bd36322 Modify lists and maps style 2016-04-24 10:18:57 +02:00
Jay Hayes
7465dca41f Add trailing commas to multi-line lists and maps 2016-04-23 20:38:43 -05:00
Uku Taht
c60f7c0033 Use 'leveling' instead of 'levelling' 2016-04-24 02:24:14 +01:00
Jay Hayes
bc29450f67 Subjective word ordering
Subjectively, I find this to read better. Perhaps it's part of my North
American dialect?
2016-04-23 13:07:38 -05:00
Jay Hayes
f780777218 Typo "apart just /as/ easily" 2016-04-23 13:07:01 -05:00