Skip to content

Instantly share code, notes, and snippets.

@PeterWAWood
Last active October 19, 2016 09:18
Show Gist options
  • Save PeterWAWood/4caea58080c506b7c5e26984e04828cc to your computer and use it in GitHub Desktop.
Save PeterWAWood/4caea58080c506b7c5e26984e04828cc to your computer and use it in GitHub Desktop.
Red/System []
sphere!: alias struct! [
radius [integer!]
]
list: declare struct![
item1 [sphere!]
item2 [sphere!]
item3 [sphere!]
]
list/item1: declare sphere!
list/item2: declare sphere!
list/item3: declare sphere!
list/item1/radius: 1
list/item2/radius: 2
list/item3/radius: 3
print [as integer! list/item1/radius " " list/item2/radius " " list/item3/radius lf]
item: declare sphere!
item: list/item1
i: 1
until [
print [i " " item/radius lf]
item: item + 1
i: i + 1
i > 3
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment