Skip to content

Instantly share code, notes, and snippets.

@PhilipWitte
Last active December 13, 2015 19:19
Show Gist options
  • Save PhilipWitte/4962255 to your computer and use it in GitHub Desktop.
Save PhilipWitte/4962255 to your computer and use it in GitHub Desktop.
dynamic array problem
func main()
{
var nums = text[] # a dynamic array
ref n : text # a 'int' reference
nums += "foo" # add "foo"
nums += "bar" # add "bar"
nums += "baz" # add "baz"
n => nums[1] # 'n' refers to 'num[1]'
if RUNTIME_CONDITION
{
nums -= nums[1] # remove 'nums[1]' from 'nums'
}
assert(n == nil) # ??
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment