This file contains hidden or 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
defmodule PersonPrinter do | |
def say_hello(Person[first_name: first, last_name: "Dudington"]) do | |
"hey it's my brother, #{first}!" | |
end | |
def say_hello(Person[first_name: first]) do | |
"hello, #{first}" | |
end | |
def say_hello(person=Person[last_name: "Dudington"]) do |
This file contains hidden or 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
10-19 15:31:43.541 6001-6001/com.isotope11.rccontroller E/AndroidRuntime﹕ FATAL EXCEPTION: main | |
java.lang.NoClassDefFoundError: org.jruby.util.JRubyFile | |
at org.jruby.RubyInstanceConfig.<init>(RubyInstanceConfig.java:84) | |
at org.jruby.embed.internal.AbstractLocalContextProvider.<init>(AbstractLocalContextProvider.java:42) | |
at org.jruby.embed.internal.SingletonLocalContextProvider.<init>(SingletonLocalContextProvider.java:88) | |
at org.jruby.embed.ScriptingContainer.getProviderInstance(ScriptingContainer.java:246) | |
at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:226) | |
at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:183) | |
at com.isotope11.rccontroller.MainActivity.setupJRuby(MainActivity.java:136) | |
at com.isotope11.rccontroller.MainActivity.onCreate(MainActivity.java:34) |
This file contains hidden or 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
$ dialyzer ec_math.erl | |
Checking whether the PLT /home/jadams/.dialyzer_plt is up-to-date... | |
dialyzer: Not a regular file: /usr/lib/erlang/lib/erts-5.10.2/ebin/erl_prim_loader.beam |
This file contains hidden or 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
iex(1)> :application.start(:gproc) | |
:ok | |
iex(2)> :application.start(:gproc) | |
{:error, {:already_started, :gproc}} | |
iex(3)> :gproc.reg({:n, :l, 'foo'}, 'bar') | |
true | |
iex(4)> :gproc.get_value({:n, :l, 'foo'}) | |
'bar' | |
iex(5)> :gproc.get_value({:n, :l, 'foos'}) | |
** (ArgumentError) argument error |
This file contains hidden or 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
iex(2)> :application.start(:gproc) | |
:ok | |
iex(3)> :gproc.reg(:foo, :bar) | |
** (ArgumentError) argument error | |
src/gproc.erl:922: :gproc.reg(:foo, :bar) | |
erl_eval.erl:569: :erl_eval.do_apply/6 | |
src/elixir.erl:138: :elixir.eval_forms/3 |
This file contains hidden or 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
--(jadams@jibbajabba)-(190/pts/7)-(2229/25-Aug-13)-- | |
--($:~/erlang/chromechat)(master)ruby-2.0.0-p0-- | |
$ git push jadams master | |
Counting objects: 5, done. | |
Delta compression using up to 4 threads. | |
Compressing objects: 100% (3/3), done. | |
Writing objects: 100% (3/3), 279 bytes, done. | |
Total 3 (delta 2), reused 0 (delta 0) | |
-----> Building chromechat ... | |
remote: WARNING: IPv4 forwarding is disabled. |
This file contains hidden or 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
calculate_bill = fn | |
{:item, price} -> price | |
[h|t] -> calculate_bill.(h) + calculate_bill.(t) | |
end | |
calculate_bill.([{:item, 20}, {:item, 10}]) | |
calculate_bill.({:item, 35}) | |
# It should also work with a list of more than two elements: | |
calculate_bill.([{:item, 20}, {:item, 10}, {:item, 35}]) |
This file contains hidden or 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
11> chatserver:join(Pid, "knewter"). | |
** exception exit: {noproc,{gen_server,call,[<0.46.0>,{join,"knewter"}]}} | |
in function gen_server:call/2 (gen_server.erl, line 180) |
This file contains hidden or 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
Eshell V5.10.2 (abort with ^G) | |
1> c(chatserver). | |
chatserver.erl:2: Warning: undefined callback function handle_cast/2 (behaviour 'gen_server') | |
chatserver.erl:18: Warning: variable 'From' is unused | |
chatserver.erl:18: Warning: variable 'State' is unused | |
chatserver.erl:18: Warning: variable 'Username' is unused | |
chatserver.erl:20: Warning: variable 'From' is unused | |
chatserver.erl:22: Warning: variable 'From' is unused | |
chatserver.erl:22: Warning: variable 'S' is unused | |
chatserver.erl:29: Warning: variable 'State' is unused |
This file contains hidden or 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
--(jadams@aye-seven)-(33/pts/22)-(1747/19-Jun-13)-- | |
--($:~/ruby/celluloid-io)(simultaneous-read-write-debug)jruby-1.7.2@celluloid_io-- | |
$ bundle exec rspec spec/celluloid/io/ssl_socket_spec.rb:84 | |
[Coveralls] Set up the SimpleCov formatter. | |
[Coveralls] Using SimpleCov's default settings. | |
/home/jadams/.rvm/gems/jruby-1.7.2@celluloid_io/gems/simplecov-0.7.1/lib/simplecov.rb:34 warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag | |
Run options: include {:locations=>{"./spec/celluloid/io/ssl_socket_spec.rb"=>[84]}} | |
Celluloid::IO::SSLSocket | |
inside Celluloid::IO |