Skip to content

Commit

Permalink
cleanup tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmuth committed Jun 30, 2024
1 parent bc32778 commit c3388e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion FrontEnd/TestData/wordcount.cw
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
(return stats))


@doc "cdecl attribute disables name mangling"
(fun main [(param argc s32) (param argv (ptr (ptr u8)))] s32 :
(trylet stats TextStats (WordCount [os::Stdin]) err :
(return 1))
Expand Down
9 changes: 2 additions & 7 deletions FrontEndDocs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module:
import fmt
@cdecl fun main(argc s32, argv ^^u8) s32:
fun main(argc s32, argv ^^u8) s32:
fmt::print#("hello world\n")
return 0
Expand All @@ -70,10 +70,6 @@ The type information in the function declaration follows the Go model of
identifier followed by type.
Functions can only return one value.

Annotations are identifiers that start with "@" and can precede certain
syntactic constructs. Here `@cdecl` disables the name mangling of function main
so it can be linked against the startup code.

`fmt::print#` is a macro call. All macros names must end in "#".


Expand Down Expand Up @@ -204,8 +200,7 @@ fun WordCount(fd os::FD) union(TextStats, os::Error):
break
return stats
-- cdecl attribute disables name mangling
@cdecl fun main(argc s32, argv ^^u8) s32:
fun main(argc s32, argv ^^u8) s32:
trylet stats TextStats = WordCount(os::Stdin), err:
return 1
-- print# is a stmt macro for printing arbitrary values.
Expand Down

0 comments on commit c3388e0

Please sign in to comment.