look past comments in a public form's header
This commit is contained in:
@@ -7,7 +7,11 @@
|
||||
|
||||
(include stdio.h)
|
||||
|
||||
(pub var greet-count int 0)
|
||||
(pub var greet-count ;; a comment in the header of a public form is
|
||||
;; not part of it: what the importer is given has
|
||||
;; to be `extern int greet-count', not a form
|
||||
;; counted off by one
|
||||
int 0)
|
||||
|
||||
(pub struct greeting ((text (* const char)) (times int)))
|
||||
|
||||
@@ -23,7 +27,8 @@
|
||||
(lambda (name field-type)
|
||||
`(printf "%s " ,(symbol->string name))))))
|
||||
|
||||
(pub fn greet ((name (* const char))) void
|
||||
(pub fn greet ;; ...and here the prototype would lose its return type
|
||||
((name (* const char))) void
|
||||
(++ greet-count)
|
||||
(printf "hello, %s\n" name))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user