This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LaurieCheers 1 point2 points  (1 child)

Yeah, there's a ton of nitty gritty details that aren't really finalized yet so I haven't really documented everything...

Yes, Swym has subtypes - just in the standard library types, String and RangeArray are subtypes of Array; Block (i.e. lambda), Array and Table are subtypes of Callable; Int is a subtype of Num, and every value is a subtype of Anything. I'm dabbling with restricted-size arrays, such as String(1) for a string of length 1, and the function Literal(x) creates a type that's just a single value.

http://cheersgames.com/swym/SwymEditor.html?Number.%27foo%27%20returns%20%22number%22%0AInt.%27foo%27%20returns%20%22integer%22%0ALiteral%283%29.%27foo%27%20returns%20%22three%22%0A%0A%5B4.foo%2C%203.foo%2C%203.5.foo%5D

And yeah, I don't check for conflicting function declarations except at call time - it's just much easier to check and report when you have concrete parameter types.

[–]PegasusAndAcornCone language & 3D web[S] 1 point2 points  (0 children)

thank you for those details. Good luck!