[erlang-questions] List of strings problem
Fri Jul 21 01:57:34 CEST 2017
Thanks for responding so quickly.
I am using Windows7 could this be causing some of my odd behavior?
On Thu, Jul 20, 2017 at 12:38 AM, PAILLEAU Eric
> indeed it is the normal behaviour.
> I suspect you do something like list flatten before so that
> [H2|T2] = T.
> [H2|T2] = [$s,$a,$m,$2] and you got "s".
> the reason why I told you to do
> [H2|T2] = [T].
> but minimal test is correct like Taras pointed.
> Le 20/07/2017 à 09:31, Taras Halturin a écrit :
>> Just to be sure...
>> Erlang/OTP 19 [erts-8.2.1] [source] [64-bit] [smp:4:4] [async-threads:10]
>> Eshell V8.2.1 (abort with ^G)
>> 1> D = [ "sam1", "sam2" ].
>> 2> [H|T] = D.
>> 3> [H2|T2] = T.
>> 4> T2.
>> 5> H2.
>> It works as you expected.
>> On Thu, Jul 20, 2017 at 10:00 AM, Éric Pailleau <eric.pailleau@REDACTED
>> <mailto:eric.pailleau@REDACTED>> wrote:
>> T is already sam2.
>> Strings are list so try [H2|T2]=[T] ...
>> erlang-questions mailing list
>> erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>> Best Regards.
>> Taras Halturin
More information about the erlang-questions