Skip to content

Commit

Permalink
alien.syntax: adding INITIALIZE-ALIEN:
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Jan 26, 2022
1 parent a107105 commit db7911c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions basis/alien/syntax/syntax-docs.factor
Expand Up @@ -125,6 +125,10 @@ HELP: C-GLOBAL:
{ $values { "type" "a C type" } { "name" "a C global variable name" } }
{ $description "Defines a getter " { $snippet "name" } " and setter " { $snippet "set-name" } " for the global value in the current library, set with " { $link POSTPONE: LIBRARY: } "." } ;

HELP: INITIALIZE-ALIEN:
{ $syntax "INITIALIZE-ALIEN: type ... ;" }
{ $description "Initializes a " { $snippet "type" } " using the provided definition." } ;

ARTICLE: "alien.enums" "Enumeration types"
"The " { $vocab-link "alien.enums" } " vocab contains the implementation for " { $link POSTPONE: ENUM: } " C types, and provides words for converting between enum singletons and integers. It is possible to dispatch off of members of an enum."
$nl
Expand Down
3 changes: 3 additions & 0 deletions basis/alien/syntax/syntax.factor
Expand Up @@ -40,3 +40,6 @@ SYNTAX: C-GLOBAL: scan-c-type scan-new-word define-global ;

SYNTAX: pointer:
scan-c-type <pointer> suffix! ;

SYNTAX: INITIALIZE-ALIEN:
scan-word parse-definition '[ _ _ initialize-alien ] append! ;

0 comments on commit db7911c

Please sign in to comment.