Dead end with macros

This commit is contained in:
2023-03-05 19:55:38 +00:00
parent ca23edabe4
commit b9d47c3181
30 changed files with 1518 additions and 332 deletions

38
src/external/numbers/mod.rs vendored Normal file
View File

@@ -0,0 +1,38 @@
mod numeric;
use numeric::Numeric;
use std::fmt::Debug;
use std::rc::Rc;
use std::hash::Hash;
use crate::{atomic_impl, atomic_redirect, externfn_impl, xfn_initial, xfn_middle, xfn_last, xfn};
use crate::foreign::{ExternError, ExternFn, Atom, Atomic};
use crate::representations::Primitive;
use crate::representations::interpreted::{Clause, InternalError};
// xfn_initial!(
// /// Multiply function
// Multiply2, Multiply1
// );
// xfn_middle!(
// /// Partially applied multiply function
// Multiply2, Multiply1, Multiply0, (
// a: Numeric: |c: &Clause| c.clone().try_into()
// )
// );
// xfn_last!(
// /// Fully applied Multiply function.
// Multiply1, Multiply0, (
// b: Numeric: |c: &Clause| c.clone().try_into(),
// a: Numeric: |c: &Clause| c.clone().try_into()
// ), Ok((*a * b).into())
// );
xfn!((
/// Multiply function
a: Numeric: |c: &Clause| c.clone().try_into(),
/// Partially applied multiply function
b: Numeric: |c: &Clause| c.clone().try_into()
), {
Ok((*a * b).into())
});