summary refs log tree commit diff stats
path: root/doc/pydoc/test.tc_displayable.html
Commit message (Expand)AuthorAgeFilesLines
* updated pydochut2010-04-191-367/+0
* updated pydochut2010-03-121-1/+14
* incremented version number and updated pydoc html files v1.0.3hut2010-02-161-334/+137
* moved pydoc pages to doc/pydochut2009-12-251-0/+551
a title='author Kartik K. Agaram <vc@akkartik.com> 2015-05-13 10:03:26 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2015-05-13 10:03:26 -0700 1363 - rename 'integer' to 'number'' href='/akkartik/mu/commit/033length.cc?h=main&id=5497090aa1e708c22cd240913a53dda32bb067aa'>5497090a ^
f652431d ^
f652431d ^

1848b18f ^

f652431d ^

f652431d ^

0487a30e ^

5ee4f1c9 ^


0487a30e ^
827898fc ^
f652431d ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

                                             
                        
             




                                      
 

                             

                                             

                                        

                                                

                                                                


                                                                                
                     
                                            

        
//: Recipe to compute the length of an array.

:(scenario array_length)
recipe main [
  1:number <- copy 3:literal  # length
  2:number <- copy 14:literal
  3:number <- copy 15:literal
  4:number <- copy 16:literal
  5:number <- length 1:array:number
]
+mem: storing 3 in location 5

:(before "End Primitive Recipe Declarations")
LENGTH,
:(before "End Primitive Recipe Numbers")
Recipe_number["length"] = LENGTH;
:(before "End Primitive Recipe Implementations")
case LENGTH: {
  reagent x = canonize(current_instruction().ingredients.at(0));
  if (x.types.at(0) != Type_number["array"]) {
    raise << "tried to calculate length of non-array " << x.to_string() << '\n';
    break;
  }
  products.resize(1);
  products.at(0).push_back(Memory[x.value]);
  break;
}