lib-nested/math/int2str/src/main.rs

38 lines
683 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

use std::{
fs::File,
io::{Read, Write},
os::unix::io::FromRawFd
};
fn main() {
nested::magic_header();
eprintln!(" Human-readably Print MachineInt");
nested::magic_header();
let mut f0 = unsafe { File::from_raw_fd(0) };
eprintln!("
> 0:
( )
( MachineInt )
( MachineWord )
( Array 8 MachineSlab )
( Pipe Shot (Array 8 MachineSlab) )
");
eprintln!("
< 1:
( )
( Sequence (Digit 10) )
( Sequence ASCII )
( Sequence MachineSlab )
( Pipe Shot (Sequence MachineSlab) )
");
nested::magic_header();
let mut bytes = [0 as u8; 8];
f0.read_exact(&mut bytes);
println!("{}", u64::from_le_bytes(bytes));
}