forked from Orchid/orchid
Import and export improved
- Import paths are now vname and not sym - Imports and exports accept multiple space-delimited operators in [] as a result, we can now reliably import and export the operator * - error reporting ergonomics
This commit is contained in:
@@ -41,7 +41,7 @@ use crate::Primitive;
|
||||
/// ```
|
||||
/// use orchidlang::{Literal};
|
||||
/// use orchidlang::interpreted::ExprInst;
|
||||
/// use orchidlang::stl::litconv::with_lit;
|
||||
/// use orchidlang::systems::cast_exprinst::with_lit;
|
||||
/// use orchidlang::{atomic_impl, atomic_redirect, externfn_impl};
|
||||
///
|
||||
/// /// Convert a literal to a string using Rust's conversions for floats, chars and
|
||||
|
||||
@@ -41,7 +41,7 @@ use crate::write_fn_step;
|
||||
///
|
||||
/// ```
|
||||
/// use orchidlang::interpreted::Clause;
|
||||
/// use orchidlang::stl::litconv::with_str;
|
||||
/// use orchidlang::systems::cast_exprinst::with_str;
|
||||
/// use orchidlang::{define_fn, Literal, Primitive};
|
||||
///
|
||||
/// define_fn! {expr=x in
|
||||
@@ -58,7 +58,7 @@ use crate::write_fn_step;
|
||||
/// A simpler format is also offered for unary functions:
|
||||
///
|
||||
/// ```
|
||||
/// use orchidlang::stl::litconv::with_lit;
|
||||
/// use orchidlang::systems::cast_exprinst::with_lit;
|
||||
/// use orchidlang::{define_fn, Literal};
|
||||
///
|
||||
/// define_fn! {
|
||||
|
||||
@@ -18,14 +18,14 @@ use crate::interpreted::ExprInst;
|
||||
/// discussed below. The newly bound names (here `s` and `i` before `=`) can
|
||||
/// also receive type annotations.
|
||||
///
|
||||
/// ```no_run
|
||||
/// ```
|
||||
/// // FIXME this is a very old example that wouldn't compile now
|
||||
/// use unicode_segmentation::UnicodeSegmentation;
|
||||
///
|
||||
/// use orchidlang::{write_fn_step, Literal, Primitive};
|
||||
/// use orchidlang::interpreted::Clause;
|
||||
/// use orchidlang::stl::litconv::{with_str, with_uint};
|
||||
/// use orchidlang::stl::RuntimeError;
|
||||
/// use orchidlang::systems::cast_exprinst::{with_str, with_uint};
|
||||
/// use orchidlang::systems::RuntimeError;
|
||||
///
|
||||
/// // Initial state
|
||||
/// write_fn_step!(pub CharAt2 > CharAt1);
|
||||
@@ -40,7 +40,7 @@ use crate::interpreted::ExprInst;
|
||||
/// i = x => with_uint(x, Ok);
|
||||
/// {
|
||||
/// if let Some(c) = s.graphemes(true).nth(*i as usize) {
|
||||
/// Ok(Literal::Char(c.to_string()).into())
|
||||
/// Ok(Literal::Str(c.to_string()).into())
|
||||
/// } else {
|
||||
/// RuntimeError::fail(
|
||||
/// "Character index out of bounds".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user