Public Gists by simo2409

Gravatar
Mon May 18 07:31:54 -0700 2009
1
lists:map(fun(Item) -> 2*Item end, List).
Gravatar
Mon May 18 07:30:25 -0700 2009
1
[Item * 2 || Item <- List].
Gravatar
Mon May 18 07:29:57 -0700 2009
1
List = [1,2,3].
Gravatar
Mon May 18 07:28:32 -0700 2009
1
CheckIfThisIsABlockedDevice = CheckPresenceOfBlockedDevices(DevicesToBlock).
Gravatar
Mon May 18 07:28:09 -0700 2009
1
2
DevicesToBlock = [iphone].
CheckPresenceOfBlockedDevices = fun(Devices) -> (fun(Device) -> lists:member(Device, Devices) end) end.
Gravatar
Mon May 18 07:27:14 -0700 2009
1
lists:member(iphone, GoAwayIphone(ThingsIDesire)).
Gravatar
Mon May 18 07:26:52 -0700 2009
1
lists:member(iphone, ThingsIDesire).
Gravatar
Mon May 18 07:25:49 -0700 2009
1
GoAwayIphone(ThingsIDesire).
Gravatar
Mon May 18 07:24:42 -0700 2009
1
GoAwayIphone = fun(Devices) -&gt; lists:delete(iphone, Devices) end.
Gravatar
Mon May 18 07:24:21 -0700 2009
1
ThingsIDesire = [iphone, mouse, keyboard].
Gravatar
Mon May 18 07:23:42 -0700 2009
1
Sum = fun(X, Y) -&gt; X+Y end.
Gravatar
Mon May 18 07:21:49 -0700 2009
1
2
3
-module(cost).
-export([total/1]).
 
Gravatar
Mon May 18 07:21:19 -0700 2009
1
2
3
ThingsToBuy = [ {iphone, 100},
                {mac, 1500},
                {mouse, 20},
Gravatar
Mon May 18 07:18:26 -0700 2009
1
[Head | RemainingString] = Name.
Gravatar
Mon May 18 07:17:49 -0700 2009
1
Name = "Simone".
Gravatar
Mon May 18 07:14:27 -0700 2009
1
[SecondThingToBuy | OtherThingsToBuy1] = OtherThingsToBuy.
Gravatar
Mon May 18 07:12:56 -0700 2009
1
[FirstThingToBuy | OtherThingsToBuy] = ToBuy.
Gravatar
Mon May 18 07:12:31 -0700 2009
1
ToBuy = [mouse, keyboard | Devices].
Gravatar
Mon May 18 07:12:03 -0700 2009
1
Devices = [iphone, mac, arduino].
Gravatar
Mon May 18 07:11:05 -0700 2009
1
[simone,marco,5,{language,erlang}]