Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -0,0 +1,6 @@
iex(1)> keys = [:one, :two, :three]
[:one, :two, :three]
iex(2)> values = [1, 2, 3]
[1, 2, 3]
iex(3)> Enum.zip(keys, values) |> Enum.into(Map.new)
%{one: 1, three: 3, two: 2}

View file

@ -1,3 +1,3 @@
my @keys = <a b c d e>;
my @vals = ^5;
my %hash = @keys Z @vals;
my %hash = flat @keys Z @vals;

View file

@ -1,2 +1,2 @@
my @v = <a b c d e>;
my %hash = @v Z @v.keys;
my %hash = @v Z=> @v.keys;

View file

@ -1 +1 @@
{ <a b c d e> Z=> ^5 }
%( <a b c d e> Z=> ^5 )

View file

@ -0,0 +1,9 @@
use std::collections::HashMap;
fn main() {
let keys = ["a", "b", "c"];
let values = [1, 2, 3];
let hash = keys.iter().zip(values.iter()).collect::<HashMap<_, _>>();
println!("{:?}", hash);
}

View file

@ -1,7 +1,6 @@
@(do
(defun hash-from-two (vec1 vec2 . hash-args)
(let ((table (hash . hash-args)))
(mapcar (do sethash table) vec1 vec2)
table))
(defun hash-from-two (vec1 vec2 . hash-args)
(let ((table (hash . hash-args)))
(mapcar (do sethash table) vec1 vec2)
table))
(prinl (hash-from-two #(a b c) #(1 2 3))))
(prinl (hash-from-two #(a b c) #(1 2 3)))