On this page:
ref
refr
len
8.12

3 List functions🔗ℹ

The list data type is identical to the one used in racket, but malt provides functions to access members of the list in the presence of automatic differentiation.

procedure

(ref lst i)  any?

  lst : (listof any?)
  i : scalar?
Returns the i’th member of lst.

procedure

(refr lst n)  (listof any?)

  lst : (listof any?)
  n : scalar?
Returns the remaining members in lst after removing the first n members. This is equivalent to drop.

procedure

(len lst)  scalar?

  lst : (listof any?)
Returns the number of members in lst.