Skip to content

Implement syntactic sugar #6

@c3d

Description

@c3d

The documentation now describes various forms of syntactic sugar which, incidentally, make most of the code written at the time of XL2 acceptable again.

Most syntactic sugar transform a prefix notation using some particular word into an infix type annotation with possibly some additions. The words being considered include: type, class, module, function, method, procedure, to, operation, data, in, out, inout, io,
constant, variable, macro, generic, polymorphic, fast, small, global, thread and static.

The transformation are generally similar to the following, and might be implementable fully in the library:

{ type T is Impl } is { T as type is Impl }
{ type T with Interface } is { T as type with Interface }
{ type T inherits Base } is { T like Base }
{ type T like Base } is { T like Base }
{ T inherits Base } is { T like Base }
{ module M is Impl } is { M as module is Impl }
{ module M with Interface } is { M as module with Interface }  
{ procedure Proc is Impl } is { Proc as mayfail is Impl }

There are quite a few more, but the pattern is relatively general and simple.

More direct compiler analysis might be needed for a few cases, but that remains to be confirmed.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions