Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 2fd1d05

Browse files
committed
[[ LCB ]] Tweak reference manual to use new 'returns' syntax.
1 parent 1737b76 commit 2fd1d05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/specs/livecode_builder_language_reference.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ The type specification for the variable is optional, if it is not specified the
215215
## Handlers
216216

217217
HandlerDefinition
218-
: 'handler' <Name: Identifier> '(' [ ParameterList ] ')' [ 'as' <ReturnType: Type> ] SEPARATOR
218+
: 'handler' <Name: Identifier> '(' [ ParameterList ] ')' [ 'returns' ( <ReturnType: Type> | 'nothing' ) ] SEPARATOR
219219
{ Statement }
220220
'end' 'handler'
221221

222222
Handler definitions are used to define functions which can be called from LiveCode Builder code, invoked as a result of events triggering in a widget module, or called from LiveCode Script if public and inside a library module.
223223

224-
There is no distinction between handlers which return a value and ones which do not, apart from the return type. Handlers can be called either in expression context, or in statement context. If a handler which returns no value (its return type is *undefined*) is called in expression context then its value is *undefined*.
224+
There is no distinction between handlers which return a value and ones which do not, apart from the return type. Handlers can be called either in expression context, or in statement context. If a handler which returns no value (it is specified as *returns nothing*) is called in expression context then its value is *undefined*.
225225

226226
ParameterList
227227
: { Parameter , ',' }
@@ -237,7 +237,7 @@ An out parameter means that no value is copied from the caller (the parameter va
237237

238238
> **Note:** It is a checked runtime error to return from a handler without ensuring all non-optional 'out' parameters have been assigned a value.
239239
240-
An inout parameter means that the value from the caller is coped to the parameter variable in the callee handler on entry, and copied back out again on exit.
240+
An inout parameter means that the value from the caller is copied to the parameter variable in the callee handler on entry, and copied back out again on exit.
241241

242242
The type of parameter is optional, if no type is specified it is taken to be *optional any* meaning it can be of any type.
243243

@@ -246,7 +246,7 @@ The type of parameter is optional, if no type is specified it is taken to be *op
246246
## Foreign Handlers
247247

248248
ForeignHandlerDefinition
249-
: 'foreign' 'handler' <Name: Identifier> '(' [ ParameterList ] ')' [ 'as' <ReturnType: Type> ] 'binds' 'to' <Binding: String>
249+
: 'foreign' 'handler' <Name: Identifier> '(' [ ParameterList ] ')' [ 'returns' ( <ReturnType: Type> | 'nothing' ) ] 'binds' 'to' <Binding: String>
250250

251251
ForeignType
252252
: Type

0 commit comments

Comments
 (0)