Handling Array Limit over runs in slice

0 views
Skip to first unread message

sg...@mozilla.com

unread,
May 30, 2017, 2:35:02 AM5/30/17
to MoonScript Users
Hello,

I really like the slice operator e.g

slice = [item for item in *items[1,5]]
however, suppose items has only 4 elements and further suppose items is backed by a FFI C array. 

Q: How would i throw an error if the user attempts to access elements beyond the bound of items?

Thanks much in advance
Saptarshi

Reply all
Reply to author
Forward
0 new messages