Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Interfaces are concepts. Duck typing, not direct inheritence
- # MemoryBounds is a constant UInt representing the pointer bytes, provided by lua impl
- using USize = UInt<MemoryBytes>; # Yuck
- # using, delete, count (operator for counting varargs, count(...). count(1, "poop", 3) will return 3)
- class Array<IType _Type, USize _uElements>; # Primitive class, provided by lua impl
- # Preceding . goes to the global scope. Ex. .Vector
- # can classes be overwritten? Added to later?
- # Function polymorphism and template specialization is chosen by declaration order.
- # How to alias functions, select specific headers, rearrange function lists
- # Are functions constant? foo() Ret {} vs foo = () Ret {}
- library math
- {
- class Vector<INumber _Type, UnsignedSize _uDimensions>
- {
- using Type = _Type;
- using Dimensions = _uDimensions;
- ctor()
- {}
- ctor(List<ICastable<Type>> list)
- {
- m_tData(list);
- }
- # FIXME: VERY iffy on this syntax for type patterns/repetition
- # This means the function takes n args based on the template arg
- # Ex. Array<USize 4> myarray(1, 2, 3, 5)
- # Need a better way to define sequences
- # Return type is implied nil/void
- Set([Type]...<0, Dimensions> args) # Class...<min, max>
- {
- # FIXME, will self be const here? Will const variables be const here? How to handle const initialization
- m_tData(args...); # Same as args<0 .. count(args...)> maybe? Need to figure out how sequences will work
- }
- # FIXME: REALLY gotta work this out, Function Lists and such
- ctor([Type]...<0, Dimensions> args) = Set([Type]...<0, Dimensions> args);
- private:
- Array<Type, Dimensions> m_tData;
- }
- }
- interface Foo
- {
- # Foo
- }
- # Foo<Bar> returns a bool, can be used in templates as concepts
- interface Foo2<IType Arg>
- {}
- # Foo2<Bar> returns an interface, Foo2<Bar><Bar2> returns a bool
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement