[erlang-questions] Printed list to Erlang function
zxq9
zxq9@REDACTED
Tue Mar 29 19:21:42 CEST 2016
Wow. Some serious copy-paste snafu my mail client was smart enough to
render invisible to me, but dumb enough to pass on to the world.
I intended to paste the following:
On 2016年3月30日 水曜日 02:13:00 zxq9 wrote:
...
> ceverett@REDACTED:~/Code/erlang$ cat member_example.erl
> -module(member_example).
> -export([go/0]).
>
> stopwords() ->
> ["word1", "word2", "word3"].
>
> is_stopword(Word) ->
> List = stopwords(),
> lists:member(Word, List).
>
> go() ->
> First = "word2",
> Second = "caboose",
> ok = io:format("~p is in stopwords: ~p~n", [First, is_stopword(First)]),
> ok = io:format("~p is in stopwords: ~p~n", [Second, is_stopword(Second)]).
> ceverett@REDACTED:~/Code/erlang$ erl
> Erlang/OTP 18 [erts-7.2] [source] [64-bit] [smp:2:2] [async-threads:10] [kernel-poll:false]
>
> Eshell V7.2 (abort with ^G)
> 1> c(member_example).
> {ok,member_example}
> 2> member_example:go().
> "word2" is in stopwords: true
> "caboose" is in stopwords: false
> ok
Ugh.
-Craig
More information about the erlang-questions
mailing list