@@ -10,38 +10,34 @@ Binary exponent
11Computes the result of `2^a`, producing an atom.
11Computes the result of `2^a`, producing an atom.
13−Accepts
13+#### Accepts
16`a` is an atom.
15`a` is an atom.
18−Produces
17+#### Produces
26− ++ bex :: binary exponent
23+ ++ bex
30 ?: =(0 a) 1
27 ?: =(0 a) 1
31 (mul 2 $(a (dec a)))
28 (mul 2 $(a (dec a)))
33−Examples
30+#### Examples
38 > (bex (add 19 1))
35 > (bex (add 19 1))
47### `++can`
43### `++can`
@@ -49,44 +45,51 @@ Examples
51Produces an atom from a list `b` of length-value pairs `p` and `q`,
47Produces an atom from a list `b` of length-value pairs `p` and `q`,
52−where `p` is the length in bloqs of size `a`, and `q` is an atomic
48+where `p` is the length in blocks of size `a`, and `q` is an atomic
55−Accepts
51+#### Accepts
58−`a` is a block size (see `++bloq`).
53+`a` is a block size (see [`++bloq`](../1c)).
60−`b` is a `++list` of length value pairs, `p` and `q`.
55+`b` is a `list` of length-value pairs, `p` and `q`.
62−Produces
57+#### Produces
70− ++ can :: assemble
63+ ++ can
72− |= [a/bloq b/(list [p=@ q=@])]
65+ |= [a=bloq b=(list [p=@ q=@])]
75− (mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
68+ (add (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
77−Examples
70+#### Examples
72+ > `@ub`21 :: @ub is the binary aura
75+ > `@ub`(can 3 ~[[1 21]])
78+ > `@ub`(can 3 ~[[1 1]])
80− > `@ub`(can 3 ~[[1 1]])
82 > `@ub`(can 0 ~[[1 255]])
81 > `@ub`(can 0 ~[[1 255]])
84− > `@ux`(can 3 [3 0xc1] [1 0xa] ~)
84+ > `@ux`(can 3 [3 0xc1] [1 0xa] ~) :: @ux is the hexadecimal aura
85 0xa00.00c1
85 0xa00.00c1
86 > `@ux`(can 3 [3 0xc1] [1 0xa] [1 0x23] ~)
87 > `@ux`(can 3 [3 0xc1] [1 0xa] [1 0x23] ~)
87 0x23.0a00.00c1
88 0x23.0a00.00c1
88 > `@ux`(can 4 [3 0xc1] [1 0xa] [1 0x23] ~)
90 > `@ux`(can 4 [3 0xc1] [1 0xa] [1 0x23] ~)
89 0x23.000a.0000.0000.00c1
91 0x23.000a.0000.0000.00c1
90 > `@ux`(can 3 ~[[1 'a'] [2 'bc']])
93 > `@ux`(can 3 ~[[1 'a'] [2 'bc']])
@@ -96,54 +99,60 @@ Examples
97Concatenate
100Concatenate
99−Concatenates two atoms, `b` and `c`, according to bloq size `a`, producing an
102+Concatenates two atoms, `b` and `c`, according to block size `a`, producing an
102−Accepts
105+#### Accepts
105−`a` is a block size (see `++bloq`).
107+`a` is a block size (see [`++bloq`](../1c)).
107`b` is an atom.
109`b` is an atom.
109`c` is an atom.
111`c` is an atom.
111−Produces
113+#### Produces
116−Source
117+#### Source
119− ++ cat :: concatenate
119+ ++ cat
121− |= {a/bloq b/@ c/@}
121+ |= [a=bloq b=@ c=@]
122 (add (lsh a (met a b) c) b)
122 (add (lsh a (met a b) c) b)
125−Examples
125+#### Examples
128− > `@ub`(cat 3 1 0)
127+ > `@ub`(cat 3 1 0) :: @ub is the binary aura
130 > `@ub`(cat 0 1 1)
130 > `@ub`(cat 0 1 1)
132 > `@ub`(cat 0 2 1)
133 > `@ub`(cat 0 2 1)
134 > `@ub`(cat 2 1 1)
136 > `@ub`(cat 2 1 1)
136 > `@ub`256
139 > `@ub`256
137 0b1.0000.0000
140 0b1.0000.0000
138 > `@ub`255
142 > `@ub`255
139 0b1111.1111
143 0b1111.1111
140 > `@ub`(cat 3 256 255)
145 > `@ub`(cat 3 256 255)
141 0b1111.1111.0000.0001.0000.0000
146 0b1111.1111.0000.0001.0000.0000
142 > `@ub`(cat 2 256 255)
148 > `@ub`(cat 2 256 255)
143 0b1111.1111.0001.0000.0000
149 0b1111.1111.0001.0000.0000
144 > (cat 3 256 255)
151 > (cat 3 256 255)
145 16.711.936
152 16.711.936
@@ -151,47 +160,53 @@ Examples
154−Slices `c` blocks of size `a` that are `b` blocks from the end of `d`.
163+Slices `c` blocks of size `a` that are positioned `b` blocks from the end of
164+`d`. That slice is produced as an atom.
156−Accepts
166+#### Accepts
159−`a` is a block size (see ++bloq).
168+`a` is a block size (see [`++bloq`](../1c)).
161`b` is an atom.
170`b` is an atom.
163`c` is an atom.
172`c` is an atom.
165−Produces
176+#### Produces
170−Source
180+#### Source
173− ++ cut :: slice
182+ ++ cut
175− |= {a/bloq {b/@u c/@u} d/@}
184+ |= [a=bloq [b=@u c=@u] d=@]
176 (end a c (rsh a b d))
185 (end a c (rsh a b d))
178−Examples
187+#### Examples
181 > (cut 0 [1 1] 2)
189 > (cut 0 [1 1] 2)
183 > (cut 0 [2 1] 4)
192 > (cut 0 [2 1] 4)
185 > `@t`(cut 3 [0 3] 'abcdefgh')
195 > `@t`(cut 3 [0 3] 'abcdefgh')
187− > `@t`(cut 3 [1 3] 'abcdefgh')
198+ > `@t`(cut 3 [1 3] 'abcdefgh') :: @t is the cord aura
189− > `@ub`(cut 0 [0 3] 0b1111.0000.1101)
201+ > `@ub`(cut 0 [0 3] 0b1111.0000.1101) :: @ub is the binary aura
191 > `@ub`(cut 0 [0 6] 0b1111.0000.1101)
204 > `@ub`(cut 0 [0 6] 0b1111.0000.1101)
193 > `@ub`(cut 0 [4 6] 0b1111.0000.1101)
207 > `@ub`(cut 0 [4 6] 0b1111.0000.1101)
194 0b11.0000
208 0b11.0000
195 > `@ub`(cut 0 [3 6] 0b1111.0000.1101)
210 > `@ub`(cut 0 [3 6] 0b1111.0000.1101)
196 0b10.0001
211 0b10.0001
@@ -204,48 +219,60 @@ Tail
205Produces an atom by taking the last `b` blocks of size `a` from `c`.
220Produces an atom by taking the last `b` blocks of size `a` from `c`.
207−Accepts
222+#### Accepts
210−`a` is a block size (see `++bloq`).
224+`a` is a block size (see [`++bloq`](../1c)).
212`b` is an atom.
226`b` is an atom.
214`c` is an atom.
228`c` is an atom.
216−Produces
230+#### Produces
222−Source
235+#### Source
225− ++ end :: tail
237+ ++ end
227− |= {a/bloq b/@u c/@}
239+ |= [a=bloq b=@u c=@]
228 (mod c (bex (mul (bex a) b)))
240 (mod c (bex (mul (bex a) b)))
231−Examples
243+#### Examples
234− > `@ub`12
254+ > `@ub`12 :: @ub is the binary aura
236 > `@ub`(end 0 3 12)
257 > `@ub`(end 0 3 12)
238 > (end 0 3 12)
260 > (end 0 3 12)
240 > `@ub`(end 1 3 12)
263 > `@ub`(end 1 3 12)
242 > (end 1 3 12)
266 > (end 1 3 12)
269+ > `@ux`'abc' :: @ux is the hexademical aura
245 0x63.6261
270 0x63.6261
246 > `@ux`(end 3 2 'abc')
272 > `@ux`(end 3 2 'abc')
248− > `@t`(end 3 2 'abc')
275+ > `@t`(end 3 2 'abc') :: @t is the cord aura
@@ -257,25 +284,22 @@ Fill bloqstream
258Produces an atom by repeating `c` for `b` blocks of size `a`.
285Produces an atom by repeating `c` for `b` blocks of size `a`.
260−Accepts
287+#### Accepts
263−`a` is a block size (see `++bloq`).
289+`a` is a block size (see [`++bloq`](../1c)).
265`b` is an atom.
291`b` is an atom.
267`c` is an atom.
293`c` is an atom.
269−Produces
295+#### Produces
274−Source
299+#### Source
277− ++ fil :: fill bloqstream
301+ ++ fil
278− |= {a/bloq b/@u c/@}
302+ |= [a=bloq b=@u c=@]
@@ -284,18 +308,23 @@ Source
284 $(d (add c (lsh a 1 d)), n +(n))
308 $(d (add c (lsh a 1 d)), n +(n))
287−Examples
311+#### Examples
290− > `@t`(fil 3 5 %a)
313+ > `@t`(fil 3 5 %a) :: @t is the cord (string) aura
292 > `@t`(fil 5 10 %ceeb)
316 > `@t`(fil 5 10 %ceeb)
293 'ceebceebceebceebceebceebceebceebceebceeb'
317 'ceebceebceebceebceebceebceebceebceebceeb'
294 > `@t`(fil 4 10 %eced)
319 > `@t`(fil 4 10 %eced)
295 'ʇʇʇʇʇʇʇʇʇʇed'
320 'ʇʇʇʇʇʇʇʇʇʇed'
296− > `@tas`(fil 4 10 %bf)
322+ > `@tas`(fil 4 10 %bf) :: @tas is the term aura
297 %bfbfbfbfbfbfbfbfbfbf
323 %bfbfbfbfbfbfbfbfbfbf
325+ > `@ub`(fil 2 6 1) :: @ub is the binary aura
326+ 0b1.0001.0001.0001.0001.0001
@@ -305,42 +334,43 @@ Left-shift
306Produces an atom by left-shifting `c` by `b` blocks of size `a`.
335Produces an atom by left-shifting `c` by `b` blocks of size `a`.
308−Accepts
337+#### Accepts
311−`a` is a block size (see `++bloq`).
339+`a` is a block size (see [`++bloq`](../1c)).
313`b` is an atom.
341`b` is an atom.
315`c` is an atom.
343`c` is an atom.
317−Produces
345+#### Produces
322−Source
349+#### Source
325− ++ lsh :: left-shift
351+ ++ lsh
327− |= {a/bloq b/@u c/@}
353+ |= [a=bloq b=@u c=@]
328 (mul (bex (mul (bex a) b)) c)
354 (mul (bex (mul (bex a) b)) c)
331−Examples
357+#### Examples
334− > `@ub`1
359+ > `@ub`1 :: @ub is the binary aura
336 > `@ub`(lsh 0 1 1)
362 > `@ub`(lsh 0 1 1)
338 > (lsh 0 1 1)
365 > (lsh 0 1 1)
340 > `@ub`255
368 > `@ub`255
341 0b1111.1111
369 0b1111.1111
342 > `@ub`(lsh 3 1 255)
371 > `@ub`(lsh 3 1 255)
343 0b1111.1111.0000.0000
372 0b1111.1111.0000.0000
344 > (lsh 3 1 255)
374 > (lsh 3 1 255)
@@ -353,33 +383,37 @@ Measure
354Computes the number of blocks of size `a` in `b`, producing an atom.
384Computes the number of blocks of size `a` in `b`, producing an atom.
356−`a` is a block size (see `++bloq`).
388+`a` is a block size (see [`++bloq`](../1c)).
358`b` is an atom.
390`b` is an atom.
360−Source
392+#### Source
363− ++ met :: measure
394+ ++ met
365− |= {a/bloq b/@}
396+ |= [a=bloq b=@]
369 ?: =(0 b) c
400 ?: =(0 b) c
370 $(b (rsh a 1 b), c +(c))
401 $(b (rsh a 1 b), c +(c))
372−Examples
403+#### Examples
375 > (met 0 1)
405 > (met 0 1)
377 > (met 0 2)
408 > (met 0 2)
379 > (met 3 255)
411 > (met 3 255)
381 > (met 3 256)
414 > (met 3 256)
383 > (met 3 'abcde')
417 > (met 3 'abcde')
@@ -390,43 +424,57 @@ Examples
391Assemble non-zero
425Assemble non-zero
393−Concatenates a list of atoms `b` using blocksize `a`, producing an atom.
427+Concatenates a list of atoms `b` using block size `a`, producing an atom.
395−Accepts
429+#### Accepts
398−`a` is a block size (see `++bloq`).
431+`a` is a block size (see [`++bloq`](../1c)).
400−`b` is a `++list` of atoms.
433+`b` is a `list` of atoms.
402−Produces
435+#### Produces
407−Source
439+#### Source
410− ++ rap :: assemble nonzero
441+ ++ rap
412− |= {a/bloq b/(list @)}
443+ |= [a=bloq b=(list @)]
415 (cat a i.b $(b t.b))
447 (cat a i.b $(b t.b))
417−Examples
449+#### Examples
420− > `@ub`(rap 2 (limo [1 2 3 4 ~]))
451+ > `@ub`(rap 2 [1 2 3 4 ~]) :: @ub is the binary aura
421 0b100.0011.0010.0001
452 0b100.0011.0010.0001
422− > `@ub`(rap 1 (limo [1 2 3 4 ~]))
454+ > `@ub`(rap 1 [1 2 3 4 ~])
423 0b1.0011.1001
455 0b1.0011.1001
424− > (rap 0 (limo [0 0 0 ~]))
457+ > (rap 0 [0 0 0 ~])
426− > (rap 0 (limo [1 0 1 ~]))
460+ > (rap 0 [1 0 1 ~])
466+ > (rap 0 [0 1 0 0 1 2 ~])
477+Any element of the value `0` is not included in concatenation.
432### `++rep`
480### `++rep`
@@ -435,48 +483,59 @@ Assemble single
436Produces an atom by assembling a list of atoms `b` using block size `a`.
484Produces an atom by assembling a list of atoms `b` using block size `a`.
438−Accepts
486+#### Accepts
441−`a` is a block size (see `++bloq`).
488+`a` is a block size (see [`++bloq`](../1c)).
443`b` is a list of atoms.
490`b` is a list of atoms.
445−Produces
492+#### Produces
450−Source
496+#### Source
453− ++ rep :: assemble single
498+ ++ rep
455− |= {a/bloq b/(list @)}
500+ |= [a=bloq b=(list @)]
460− (con (lsh a c (end a 1 i.b)) $(c +(c), b t.b))
505+ (add (lsh a c (end a 1 i.b)) $(c +(c), b t.b))
462−Examples
507+#### Examples
465− > `@ub`(rep 2 (limo [1 2 3 4 ~]))
509+ > `@ub`(rep 2 [1 2 3 4 ~]) :: @ub is the binary aura
466 0b100.0011.0010.0001
510 0b100.0011.0010.0001
467− > (rep 0 (limo [0 0 1 ~]))
512+ > (rep 0 [0 0 1 ~])
469− > (rep 0 (limo [0 0 0 1 ~]))
515+ > (rep 0 [0 0 0 1 ~])
518+ > `@ub`(rep 0 [0 0 0 1 ~])
471− > (rep 0 (limo [0 1 0 0 ~]))
524+ > (rep 0 [0 1 0 0 ~])
473− > (rep 0 (limo [0 1 0 1 ~]))
527+ > (rep 0 [0 1 0 1 ~])
475− > (rep 0 (limo [0 1 0 1 0 1 ~]))
530+ > (rep 0 [1 0 1 0 1 ~])
477− > `@ub`42
533+ > `@ub`21
478 0b10.1010
534 0b10.1010
536+ > `@ub`(rep 3 [12 166 8 34 ~])
537+ 0b10.0010.0000.1000.1010.0110.0000.1100
@@ -486,45 +545,51 @@ Disassemble
487Produces a list of atoms from the bits of `b` using block size `a`.
546Produces a list of atoms from the bits of `b` using block size `a`.
489−Accepts
548+#### Accepts
492−`a` is a block size (see `++bloq`).
550+`a` is a block size (see [`++bloq`](../1c)).
494`b` is an atom.
552`b` is an atom.
496−Produces
554+#### Produces
499A list of atoms.
556A list of atoms.
501−Source
558+#### Source
504− ++ rip :: disassemble
560+ ++ rip
506− |= {a/bloq b/@}
562+ |= [a=bloq b=@]
507 ^- (list @)
563 ^- (list @)
508 ?: =(0 b) ~
564 ?: =(0 b) ~
509 [(end a 1 b) $(b (rsh a 1 b))]
565 [(end a 1 b) $(b (rsh a 1 b))]
511−Examples
567+#### Examples
514− > `@ub`155
569+ > `@ub`155 :: @ub is the binary aura
515 0b1001.1011
570 0b1001.1011
516 > (rip 0 155)
572 > (rip 0 155)
517 ~[1 1 0 1 1 0 0 1]
573 ~[1 1 0 1 1 0 0 1]
518 > (rip 2 155)
575 > (rip 2 155)
520 > (rip 1 155)
581 > (rip 1 155)
521 ~[3 2 1 2]
582 ~[3 2 1 2]
522 > `@ub`256
584 > `@ub`256
523 0b1.0000.0000
585 0b1.0000.0000
524 > (rip 0 256)
587 > (rip 0 256)
525 ~[0 0 0 0 0 0 0 0 1]
588 ~[0 0 0 0 0 0 0 0 1]
526 > (rip 2 256)
590 > (rip 2 256)
528 > (rip 3 256)
593 > (rip 3 256)
@@ -537,51 +602,57 @@ Right-shift
538Right-shifts `c` by `b` blocks of size `a`, producing an atom.
603Right-shifts `c` by `b` blocks of size `a`, producing an atom.
540−Accepts
605+#### Accepts
543−`a` is a block size (see `++bloq`).
607+`a` is a block size (see [`++bloq`](../1c)).
545`b` is an atom.
609`b` is an atom.
547`c` is an atom.
611`c` is an atom.
549−Produces
613+#### Produces
554−Source
617+#### Source
557− ++ rsh :: right-shift
619+ ++ rsh
559− |= {a/bloq b/@u c/@}
621+ |= [a=bloq b=@u c=@]
560 (div c (bex (mul (bex a) b)))
622 (div c (bex (mul (bex a) b)))
562−Examples
624+#### Examples
565− > `@ub`145
626+ > `@ub`145 :: @ub is the binary aura
566 0b1001.0001
627 0b1001.0001
567 > `@ub`(rsh 1 1 145)
629 > `@ub`(rsh 1 1 145)
568 0b10.0100
630 0b10.0100
569 > (rsh 1 1 145)
632 > (rsh 1 1 145)
571 > `@ub`(rsh 2 1 145)
635 > `@ub`(rsh 2 1 145)
573 > (rsh 2 1 145)
638 > (rsh 2 1 145)
575 > `@ub`10
641 > `@ub`10
577 > `@ub`(rsh 0 1 10)
644 > `@ub`(rsh 0 1 10)
579 > (rsh 0 1 10)
647 > (rsh 0 1 10)
581 > `@ux`'abc'
650 > `@ux`'abc'
582 0x63.6261
651 0x63.6261
583 > `@t`(rsh 3 1 'abc')
653 > `@t`(rsh 3 1 'abc')
585 > `@ux`(rsh 3 1 'abc')
656 > `@ux`(rsh 3 1 'abc')
@@ -592,39 +663,39 @@ Examples
593Reverse block order
664Reverse block order
595−Switches little endian to big and vice versa: produces an atom by
666+Switches little-endian to big-endian and vice versa: produces an atom by
596reversing the block order of `b` using block size `a`.
667reversing the block order of `b` using block size `a`.
599−Accepts
670+#### Accepts
602−`a` is a block size (see `++bloq`).
672+`a` is a block size (see [`++bloq`](../1c)).
604`b` is an atom.
674`b` is an atom.
606−Produces
676+#### Produces
611−Source
680+#### Source
614− ++ swap |=({a/bloq b/@} (rep a (flop (rip a b)))) :: reverse bloq order
682+ ++ swp |=([a=bloq b=@] (rep a (flop (rip a b))))
616−Examples
684+#### Examples
619− > `@ub`24
686+ > `@ub`24 :: @ub is the binary aura
621− > (swap 0 24)
689+ > (swp 0 24)
627− > (swap 0 128)
698+ > (swp 0 128)
@@ -636,38 +707,39 @@ Binary logarithm
637Computes the base-2 logarithm of `a`, producing an atom.
708Computes the base-2 logarithm of `a`, producing an atom.
639−Accepts
710+#### Accepts
642`a` is an atom.
712`a` is an atom.
644−Produces
714+#### Produces
649−Source
718+#### Source
652− ++ xeb :: binary logarithm
720+ ++ xeb
656 (met 0 a)
724 (met 0 a)
658−Examples
726+#### Examples
661 > (xeb 31)
728 > (xeb 31)
663 > (xeb 32)
731 > (xeb 32)
665 > (xeb 49)
734 > (xeb 49)
667 > (xeb 0)
737 > (xeb 0)
669 > (xeb 1)
740 > (xeb 1)
671 > (xeb 2)
743 > (xeb 2)