mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
New generic syntax and ad hoc invocation.
This commit is contained in:
committed by
Christoffer Lerno
parent
276281c3f9
commit
4f7b42cdc4
@@ -79,13 +79,13 @@ import stack;
|
||||
|
||||
// Define our new types, the first will implicitly create
|
||||
// a complete copy of the entire Stack module with "Type" set to "int"
|
||||
def IntStack = Stack<int>;
|
||||
def IntStack = Stack(<int>);
|
||||
// The second creates another copy with "Type" set to "double"
|
||||
def DoubleStack = Stack<double>;
|
||||
def DoubleStack = Stack(<double>);
|
||||
|
||||
// If we had added "define IntStack2 = Stack<int>"
|
||||
// If we had added "define IntStack2 = Stack(<int>)"
|
||||
// no additional copy would have been made (since we already
|
||||
// have an parameterization of Stack<int>) so it would
|
||||
// have an parameterization of Stack(<int>)) so it would
|
||||
// be same as declaring IntStack2 an alias of IntStack
|
||||
|
||||
// Importing an external C function is straightforward
|
||||
|
||||
Reference in New Issue
Block a user