Getting information from a series

A series can contain values of any type, even a mixture of types. It is often important to know how many items a series contains. This is given by the length? property: 

;-- see Chapter05/getting-info.red:data: [A B C D]length? data ;== 4

If a series has no items, it is empty—the empty? function returns true:

empty-lst: []length? empty-lst ;== 0empty? empty-lst  ;== true

Get Learn Red - Fundamentals of Red now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.