finally figure out how to hold closures

This commit is contained in:
Aidan Hahn 2022-01-16 22:01:42 -08:00
parent 69f31db23b
commit f805290a4b
No known key found for this signature in database
GPG key ID: 327711E983899316
8 changed files with 98 additions and 89 deletions

View file

@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
use crate::func::{FTable, Function, Args, Operation};
use crate::vars::{VTable};
use crate::segment::{Ctr, Ast, circuit, ast_as_string};
@ -29,7 +29,7 @@ pub fn get_echo() -> Function {
loose_syms: false,
eval_lazy: false,
args: Args::Lazy(-1),
function: Operation::Internal(
function: Operation::Internal(Box::new(
|a: Ast, _b: Rc<RefCell<VTable>>, _c: Rc<RefCell<FTable>>| -> Ctr {
let mut string = String::from("");
if !circuit(a, &mut |arg: &Ctr| {
@ -50,7 +50,7 @@ pub fn get_echo() -> Function {
}
return Ctr::None;
}
)
))
};
}
@ -60,7 +60,7 @@ pub fn get_concat() -> Function {
loose_syms: false,
eval_lazy: false,
args: Args::Lazy(-1),
function: Operation::Internal(
function: Operation::Internal(Box::new(
|a: Ast, _b: Rc<RefCell<VTable>>, _c: Rc<RefCell<FTable>>| -> Ctr {
let mut string = String::from("");
if !circuit(a, &mut |arg: &Ctr| {
@ -80,7 +80,6 @@ pub fn get_concat() -> Function {
}
return Ctr::String(string);
}
)
))
};
}
*/