ufm: (bald-headed)
[personal profile] ufm

<< <<V:8>> || V <- [1,2,3,4,5,6,7,8,9] >>.

<<1,2,3,4,5,6,7,8,9>>



Originally published at U.F.M's Homepage. You can comment here or there.

(no subject)

Date: 2014-03-07 07:43 (UTC)
From: [identity profile] dil.livejournal.com
Что это?!

(no subject)

Date: 2014-03-07 09:10 (UTC)
From: [identity profile] ufm.livejournal.com
Эрланг. Не бери в голову.

(no subject)

Date: 2014-03-09 13:03 (UTC)
From: [identity profile] -oxpa-.livejournal.com
Это такой binayr:bin_to_list/1 для целых чисел до 256 ? О_о

(no subject)

Date: 2014-03-09 20:44 (UTC)
From: [identity profile] ufm.livejournal.com
Это http://www.erlang.org/doc/programming_examples/list_comprehensions.html
Я просто не знал, что оно работает не только для списков, но и для бинари.

(no subject)

Date: 2014-03-09 20:46 (UTC)
From: [identity profile] -oxpa-.livejournal.com
только в твоём случае это из списка получают binary. А можно ещё и из собственно байнари, заменив <- на <=.

Честно говоря, это чуть ли не мой любимый приём в свете https://github.com/oxpa/watchbasedir/blob/master/rpm_read.erl который я собираюсь допилить до "yet another createrepo"