We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 37c71b9 commit 4b9857eCopy full SHA for 4b9857e
1 file changed
src/protocols/ifn.rs
@@ -0,0 +1,17 @@
1
+use crate::value::{Value,ToValue};
2
+use std::rc::Rc;
3
+use crate::ifn;
4
+
5
+// Let's keep it simple for now, but we will expand this
6
+define_protocol!(IFn,IFn);
7
8
+impl ifn::IFn for IFn {
9
+ fn invoke(&self, args: Vec<Rc<Value>>) -> Value {
10
+ match &*self.value {
11
+ Value::IFn(ifn) => {
12
+ ifn.invoke(args)
13
+ },
14
+ _ => panic!("Called Iterable iter on non-iterable"),
15
+ }
16
17
+}
0 commit comments