Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | quanta |
what | in | value(s) that will be filled cyclically in array | |
Allowed: | any or vector/array of any | ||
... | in | slicing dimensions | |
Allowed: | integers, an index record, integer vectors |
- x := dq.unit('5km/s') # a record - x:: [id=quant] - print a := r_array(x,3,2) # a record array [*40=[value=5, unit=km/s], *41=[value=5, unit=km/s], *42=[value=5, unit=km/s], *43=[value=5, unit=km/s], *44=[value=5, unit=km/s], *45=[value=5, unit=km/s]] - a:: [id=quant, shape=[3 2] ] - r_fill(dq.unit('2s'), a, 2, 1) # overwrite an element T - a [*40=[value=5, unit=km/s], *41=[value=2, unit=s], *42=[value=5, unit=km/s], *43=[value=5, unit=km/s], *44=[value=5, unit=km/s], *45=[value=5, unit=km/s]] - r_fill(dq.unit(), a, 3,) # a few more T - a [*40=[value=5, unit=km/s], *41=[value=2, unit=s], *42=[value=1, unit=], *43=[value=5, unit=km/s], *44=[value=5, unit=km/s], *45=[value=1, unit=]] - b := dq.unit('2s') # see what happens - b::shape := 2 # if made an array - r_fill(b, a, 3,) T - a [*40=[value=5, unit=km/s], *41=[value=2, unit=s], *42=2, *43=[value=5, unit=km/s], *44=[value=5, unit=km/s], *45=s]