Skip to content

New Syntax #4

Description

@grencez
;;; Variables.
; Untyped variable declaration + assignment.
(: my_var value)
; Typed variable declaration + assignment.
(: my_var Type value)

;;; Functions.
; Untyped second argument and return value.
(: (my_func (arg1 Type) arg2)
  (+ arg1 arg2))
; Result and arg types are given.
(: (my_func (arg1 Type) (arg2 Type))
  ResultType
  (+ arg1 arg2))

;;; Type declarations.
; Ground literal
(: (MyType))
; Union.
(: (MyType) OptionType1 OptionType2)
; Struct.
(: (MyType (member1 Type1) (member2 Type2)))

That should be enough for feature parity. Ground terms are just ground literals and/or structures with ground term members.

Idk how function args work. Guess they have to be written as untyped for now.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions