aboutsummaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
Diffstat (limited to 'rust')
-rw-r--r--rust/src/step7_quote.rs6
-rw-r--r--rust/src/step8_macros.rs6
-rw-r--r--rust/src/step9_try.rs6
-rw-r--r--rust/src/stepA_interop.rs6
4 files changed, 12 insertions, 12 deletions
diff --git a/rust/src/step7_quote.rs b/rust/src/step7_quote.rs
index bdfdf24..a46f548 100644
--- a/rust/src/step7_quote.rs
+++ b/rust/src/step7_quote.rs
@@ -26,7 +26,7 @@ fn read(str: String) -> MalRet {
// eval
fn is_pair(x: MalVal) -> bool {
match *x {
- List(ref lst,_) => lst.len() > 0,
+ List(ref lst,_) | Vector(ref lst,_) => lst.len() > 0,
_ => false,
}
}
@@ -37,7 +37,7 @@ fn quasiquote(ast: MalVal) -> MalVal {
}
match *ast.clone() {
- List(ref args,_) => {
+ List(ref args,_) | Vector(ref args,_) => {
let ref a0 = args[0];
match **a0 {
Sym(ref s) => {
@@ -50,7 +50,7 @@ fn quasiquote(ast: MalVal) -> MalVal {
}
if is_pair(a0.clone()) {
match **a0 {
- List(ref a0args,_) => {
+ List(ref a0args,_) | Vector(ref a0args,_) => {
let a00 = a0args[0].clone();
match *a00 {
Sym(ref s) => {
diff --git a/rust/src/step8_macros.rs b/rust/src/step8_macros.rs
index 3e5f8a7..fbbaf35 100644
--- a/rust/src/step8_macros.rs
+++ b/rust/src/step8_macros.rs
@@ -26,7 +26,7 @@ fn read(str: String) -> MalRet {
// eval
fn is_pair(x: MalVal) -> bool {
match *x {
- List(ref lst,_) => lst.len() > 0,
+ List(ref lst,_) | Vector(ref lst,_) => lst.len() > 0,
_ => false,
}
}
@@ -37,7 +37,7 @@ fn quasiquote(ast: MalVal) -> MalVal {
}
match *ast.clone() {
- List(ref args,_) => {
+ List(ref args,_) | Vector(ref args,_) => {
let ref a0 = args[0];
match **a0 {
Sym(ref s) => {
@@ -50,7 +50,7 @@ fn quasiquote(ast: MalVal) -> MalVal {
}
if is_pair(a0.clone()) {
match **a0 {
- List(ref a0args,_) => {
+ List(ref a0args,_) | Vector(ref a0args,_) => {
let a00 = a0args[0].clone();
match *a00 {
Sym(ref s) => {
diff --git a/rust/src/step9_try.rs b/rust/src/step9_try.rs
index c36abcb..4449661 100644
--- a/rust/src/step9_try.rs
+++ b/rust/src/step9_try.rs
@@ -26,7 +26,7 @@ fn read(str: String) -> MalRet {
// eval
fn is_pair(x: MalVal) -> bool {
match *x {
- List(ref lst,_) => lst.len() > 0,
+ List(ref lst,_) | Vector(ref lst,_) => lst.len() > 0,
_ => false,
}
}
@@ -37,7 +37,7 @@ fn quasiquote(ast: MalVal) -> MalVal {
}
match *ast.clone() {
- List(ref args,_) => {
+ List(ref args,_) | Vector(ref args,_) => {
let ref a0 = args[0];
match **a0 {
Sym(ref s) => {
@@ -50,7 +50,7 @@ fn quasiquote(ast: MalVal) -> MalVal {
}
if is_pair(a0.clone()) {
match **a0 {
- List(ref a0args,_) => {
+ List(ref a0args,_) | Vector(ref a0args,_) => {
let a00 = a0args[0].clone();
match *a00 {
Sym(ref s) => {
diff --git a/rust/src/stepA_interop.rs b/rust/src/stepA_interop.rs
index c36abcb..4449661 100644
--- a/rust/src/stepA_interop.rs
+++ b/rust/src/stepA_interop.rs
@@ -26,7 +26,7 @@ fn read(str: String) -> MalRet {
// eval
fn is_pair(x: MalVal) -> bool {
match *x {
- List(ref lst,_) => lst.len() > 0,
+ List(ref lst,_) | Vector(ref lst,_) => lst.len() > 0,
_ => false,
}
}
@@ -37,7 +37,7 @@ fn quasiquote(ast: MalVal) -> MalVal {
}
match *ast.clone() {
- List(ref args,_) => {
+ List(ref args,_) | Vector(ref args,_) => {
let ref a0 = args[0];
match **a0 {
Sym(ref s) => {
@@ -50,7 +50,7 @@ fn quasiquote(ast: MalVal) -> MalVal {
}
if is_pair(a0.clone()) {
match **a0 {
- List(ref a0args,_) => {
+ List(ref a0args,_) | Vector(ref a0args,_) => {
let a00 = a0args[0].clone();
match *a00 {
Sym(ref s) => {