on master help sign in
Merge pull request #928 from sigilante/master
d97e33bDavid Kerschner
tutorials/vere/jetting.md+11−2
@@ -534,6 +534,8 @@ If you need to get the size
534 u3r_met(3, a);
534 u3r_met(3, a);
535```
535```
536
536
537+Cells have their own set of characteristic functions for accessing interior nouns: `u3r_cell`, `u3r_trel`, `u3r_qual`, `u3h`, `u3t`, and the like.
538+
537The actual meat of the function is up to you. What is it supposed to do?
539The actual meat of the function is up to you. What is it supposed to do?
538
540
539Now we move on to return semantics.
541Now we move on to return semantics.
@@ -600,7 +602,7 @@ ending your C code with
600 return(123);
602 return(123);
601```
603```
602
604
603−is wrong and will result in a dojo error because you are returning a single atom, instead of a list of three atoms.
605+is wrong and will result in a dojo error because you are returning a single atom, instead of a tuple containing three atoms.
604
606
605Instead do one of these:
607Instead do one of these:
606
608
@@ -610,7 +612,7 @@ Instead do one of these:
610 return(u3nq(a, b, c, d)); // for four atoms
612 return(u3nq(a, b, c, d)); // for four atoms
611```
613```
612
614
613−If you need to return a longer list, you can compose your own. Look
615+If you need to return a longer tuple, you can compose your own. Look
614at the definitions of these three functions and you will see that they
616at the definitions of these three functions and you will see that they
615are just recursive calls to the cell constructor `u3i_cell()` e.g.
617are just recursive calls to the cell constructor `u3i_cell()` e.g.
616
618
@@ -618,6 +620,13 @@ are just recursive calls to the cell constructor `u3i_cell()` e.g.
618 u3i_cell(a, u3i_cell(b, u3i_cell(c, d));
620 u3i_cell(a, u3i_cell(b, u3i_cell(c, d));
619```
621```
620
622
623+This implies that, to create a list instead of a cell, you will need to append
624+`u3_nul` to the appropriately-sized tuple constructor:
625+
626+```c
627+ return(u3nt(a, b, u3_nul)); // for two atoms as a list
628+```
629+
621Understanding the memory model, allocation, freeing, and ownership ('transfer' vs 'retain' semantics) is important. Some info is available at [Nouns](@/docs/tutorials/vere/nouns.md).
630Understanding the memory model, allocation, freeing, and ownership ('transfer' vs 'retain' semantics) is important. Some info is available at [Nouns](@/docs/tutorials/vere/nouns.md).
622
631
623## Compile the C code
632## Compile the C code