Move Complex struct to its own file

This commit is contained in:
Eryn Wells 2017-04-12 09:36:30 -07:00
parent a60ec25c8e
commit 74f98379b9
2 changed files with 21 additions and 11 deletions

View file

@ -0,0 +1,19 @@
/* types/src/number/complex.rs
* Eryn Wells <eryn@erynwells.me>
*/
use number::Real;
use value::*;
#[derive(Debug, PartialEq)]
pub struct Complex {
real: Real,
imag: Real
}
impl IsBool for Complex { }
impl IsChar for Complex { }
impl IsNumber for Complex {
fn is_complex(&self) -> bool { true }
}

View file

@ -7,9 +7,11 @@
/// Scheme numbers are complex, literally.
pub mod real;
pub mod complex;
mod add;
pub use self::real::Real;
pub use self::complex::Complex;
use std::any::Any;
use std::fmt::Debug;
@ -46,14 +48,3 @@ impl ValueEq for Box<Number> {
}
fn as_any(&self) -> &Any { self }
}
#[derive(Debug, PartialEq)]
struct Complex {
real: Real,
imag: Real
}
impl IsNumber for Complex {
fn is_complex(&self) -> bool { true }
}