Skip to content

Instantly share code, notes, and snippets.

@vapidbabble
Last active November 4, 2016 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vapidbabble/277ac0fe8d14e33f7c2947e5c6f2135d to your computer and use it in GitHub Desktop.
Save vapidbabble/277ac0fe8d14e33f7c2947e5c6f2135d to your computer and use it in GitHub Desktop.
1.
function=lambda{|x| Math.sin(x)}
(1..50).to_a.shuffle.take(5).map {|x| function[x]}
2.
function=fn(x)-> :math.sin(x) end
(1..50) |> Enum.take_random(5) |> Enum.map function
3.
(def function(fn [ele] (Math/sin ele)) )
(map (fn [ele] (function ele)) (take 5 (shuffle (range 1 50)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment