diff --git a/elprop/src/bin/code/data.rs b/elprop/src/bin/code/data.rs index fa90a50f..c0bd18c2 100755 --- a/elprop/src/bin/code/data.rs +++ b/elprop/src/bin/code/data.rs @@ -20,6 +20,7 @@ pub(crate) enum Type { HashTable, Record, ByteFn, + Byte, Subr, Buffer, Nil, @@ -57,6 +58,7 @@ impl Type { } Type::HashTable => todo!("Strategy for HashTable not implemented"), Type::ByteFn => any::().prop_map(ArbitraryType::ByteFn).boxed(), + Type::Byte => any::().prop_map(ArbitraryType::Byte).boxed(), Type::Subr => todo!("Strategy for Subr not implemented"), Type::Buffer => any::().prop_map(ArbitraryType::Buffer).boxed(), Type::Nil => Just(ArbitraryType::Nil).boxed(), @@ -160,6 +162,7 @@ pub(crate) enum ArbitraryType { Nil, Function(u8), ByteFn(u8), + Byte(u8), Char(char), Buffer(String), Subr(u8), @@ -267,6 +270,7 @@ impl std::fmt::Display for ArbitraryType { } write!(f, ") nil)") } + ArbitraryType::Byte(n) => write!(f, "{n}"), ArbitraryType::Buffer(name) => { write!(f, "(generate-new-buffer {name})") } @@ -369,6 +373,7 @@ impl Function { "Number" | "NumberValue" => Type::Multiple(vec![Type::Integer, Type::Float]), "Object" => Type::Unknown, "usize" | "u64" => Type::PosInteger, + "u8" => Type::Byte, "isize" | "i64" => Type::Integer, "str" | "String" | "LispString" => Type::String, "bool" | "OptionalFlag" => Type::Boolean, diff --git a/elprop/src/elprop.el b/elprop/src/elprop.el index 99cfaf53..df3b8724 100644 --- a/elprop/src/elprop.el +++ b/elprop/src/elprop.el @@ -10,6 +10,7 @@ (kill-buffer "*elprop-output*")) (let* ((buffer "*elprop-output*") + (process-connection-type nil) (process (start-process "elprop-process" buffer (getenv "ELPROP_RUNNER"))) (runner-count 0) (pointer 1)) diff --git a/src/alloc.rs b/src/alloc.rs index c1e22af9..78fd066a 100644 --- a/src/alloc.rs +++ b/src/alloc.rs @@ -5,7 +5,7 @@ use crate::core::object::{ ByteFn, ByteString, FnArgs, Gc, IntoObject, LispVec, Object, RecordBuilder, Symbol, NIL, }; use anyhow::{ensure, Result}; -use rune_macros::defun; +use rune_macros::{defun, elprop}; #[defun] pub(crate) fn list<'ob>(objects: &[Object<'ob>], cx: &'ob Context) -> Object<'ob> { @@ -63,6 +63,7 @@ pub(crate) fn make_byte_code<'ob>( } #[defun] +#[elprop(u8, _)] fn make_vector(length: usize, init: Object) -> Vec { vec![init; length] }