<div dir="ltr">why do you want the list in a module, rather than loaded dynamically on startup? The list is data, which is probably best kept separate from the code.<div><br></div><div>consider, e.g.:</div><div><br></div><div><a href="https://gist.github.com/anonymous/7dd00fc5fba177f6dd2041edfe9ad09e">https://gist.github.com/anonymous/7dd00fc5fba177f6dd2041edfe9ad09e</a><br></div><div><br></div><div>not a ton of code, and loads a list with a string per line. And you can change the list without recompiling and re-shipping the code. A lot to like about that.</div><div><br></div><div>F.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 29, 2016 at 10:52 AM, <span dir="ltr"><<a href="mailto:lloyd@writersglen.com" target="_blank">lloyd@writersglen.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi zxq9,<br>
<br>
As noted by Sergej, the issue for me was how to transform the list on the printed page into an Erlang list that I could process further; e.g. how to get from the printed list to stopwords/0 with minimum steps along the way.<br>
<br>
My efforts were taking from copy into file, read back into binary, convert to list, use string:tokens/2 to transform newlines of commas, yada yada... until I had a list in the Erlang shell. But, then, how do I move that list into module? I could do it with another search and replace, but in all, it felt ugly.<br>
<br>
Thanks,<br>
<br>
LRP<br>
<span class="im HOEnZb"><br>
<br>
<br>
-----Original Message-----<br>
From: "zxq9" <<a href="mailto:zxq9@zxq9.com">zxq9@zxq9.com</a>><br>
Sent: Tuesday, March 29, 2016 1:21pm<br>
To: <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
Subject: Re: [erlang-questions] Printed list to Erlang function<br>
<br>
</span><div class="HOEnZb"><div class="h5">Wow. Some serious copy-paste snafu my mail client was smart enough to<br>
render invisible to me, but dumb enough to pass on to the world.<br>
<br>
I intended to paste the following:<br>
<br>
On 2016年3月30日 水曜日 02:13:00 zxq9 wrote:<br>
...<br>
> ceverett@changa:~/Code/erlang$ cat member_example.erl<br>
> -module(member_example).<br>
> -export([go/0]).<br>
><br>
> stopwords() -><br>
> ["word1", "word2", "word3"].<br>
><br>
> is_stopword(Word) -><br>
> List = stopwords(),<br>
> lists:member(Word, List).<br>
><br>
> go() -><br>
> First = "word2",<br>
> Second = "caboose",<br>
> ok = io:format("~p is in stopwords: ~p~n", [First, is_stopword(First)]),<br>
> ok = io:format("~p is in stopwords: ~p~n", [Second, is_stopword(Second)]).<br>
> ceverett@changa:~/Code/erlang$ erl<br>
> Erlang/OTP 18 [erts-7.2] [source] [64-bit] [smp:2:2] [async-threads:10] [kernel-poll:false]<br>
><br>
> Eshell V7.2 (abort with ^G)<br>
> 1> c(member_example).<br>
> {ok,member_example}<br>
> 2> member_example:go().<br>
> "word2" is in stopwords: true<br>
> "caboose" is in stopwords: false<br>
> ok<br>
<br>
Ugh.<br>
<br>
-Craig<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div>