mirror of
https://github.com/urbit/ares.git
synced 2024-12-25 06:12:24 +03:00
hoon, jets: add +cap
This commit is contained in:
parent
866f3dae3d
commit
5a2e4eec57
@ -133,6 +133,20 @@
|
||||
?: =(0 b) a
|
||||
$(a (dec a), b (dec b))
|
||||
::
|
||||
:: Tree addressing
|
||||
::
|
||||
++ cap :: index in head or tail
|
||||
~/ %cap
|
||||
|= a=@
|
||||
~> %sham.%cap
|
||||
^- ?(%2 %3)
|
||||
?- a
|
||||
%2 %2
|
||||
%3 %3
|
||||
?(%0 %1) !!
|
||||
* $(a (div a 2))
|
||||
==
|
||||
::
|
||||
:: List logic
|
||||
::
|
||||
++ flop :: reverse
|
||||
|
@ -1,8 +1,10 @@
|
||||
pub mod math;
|
||||
pub mod mink;
|
||||
pub mod tree;
|
||||
|
||||
use crate::jets::math::*;
|
||||
use crate::jets::mink::*;
|
||||
use crate::jets::tree::*;
|
||||
use crate::mem::NockStack;
|
||||
use crate::newt::Newt;
|
||||
use crate::noun::{self, Noun, Slots};
|
||||
@ -66,6 +68,9 @@ pub fn get_jet(jet_name: Noun) -> Option<Jet> {
|
||||
tas!(b"met") => Some(jet_met),
|
||||
tas!(b"mug") => Some(jet_mug),
|
||||
tas!(b"rev") => Some(jet_rev),
|
||||
//
|
||||
tas!(b"cap") => Some(jet_cap),
|
||||
//
|
||||
tas!(b"mink") => Some(jet_mink),
|
||||
_ => {
|
||||
// eprintln!("Unknown jet: {:?}", jet_name);
|
||||
|
1447
rust/ares/src/jets/tree.rs
Normal file
1447
rust/ares/src/jets/tree.rs
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user