~jojo/Carth

ref: 922160a41066d5508a641e93012690f529757090 Carth/REFERENCE.org -rw-r--r-- 1.1 KiB
922160a4Johan Johansson Fix programs not being allowed to start with whitespace 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#+TITLE: The Carth Reference

This document is the primary reference for the Carth programming
language. It is updated on a best-effort basis. It should be valid and
complete, but it may not be.

* TODO Introduction

** TODO How to use this document

** TODO Contributing

** TODO Influences

** TODO Glossary

* TODO Lexical structure

* TODO Macros

* TODO Packages, modules, and source files

* TODO Items

** TODO Global variable definitions

** TODO Type definitions

* TODO Expressions

** Type ascriptions
   Type ascriptions are primarily used to:
   - increase readability when the type of an expression is not obvious;
   - assert at compile-time that an expression is of or can specialize to the given type;
   - or specialize the type of a generic expression, restricting its usage.

*** Syntax
    #+BEGIN_SRC bnf
    type ascription = "(", ":", expression, type, ")" ;
    #+END_SRC

*** Example
    #+BEGIN_SRC scheme
    (: x Int)
    #+END_SRC

* TODO Patterns

* TODO Type system

* TODO Memory model

* TODO Linkage

* TODO Unsafety

* TODO Compile time evaluation

* TODO Runtime