Skip to content

Commit 4fce5ed

Browse files
committed
Interoperability.md: update documentation on interop protocol extensibility with expected return type for interop message extension methods
1 parent d198aa1 commit 4fce5ed

File tree

1 file changed

+57
-57
lines changed

1 file changed

+57
-57
lines changed

docs/user/Interoperability.md

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -281,63 +281,63 @@ The naming convention for the `register_interop_behavior` keyword arguments foll
281281
becomes `fits_in_long` and so on. Each message can be extended with a **pure python function** (default keyword arguments, free vars and cell vars are not allowed) or a **boolean constant**.
282282
Following is the list of currently supported interop messages:
283283

284-
| Truffle Message | Extension argument name |
285-
|:-------------------------|:----------------------------|
286-
| isBoolean | is_boolean |
287-
| isDate | is_date |
288-
| isDuration | is_duration |
289-
| isIterator | is_iterator |
290-
| isNumber | is_number |
291-
| isString | is_string |
292-
| isTime | is_time |
293-
| isTimeZone | is_time_zone |
294-
| isExecutable | is_executable |
295-
| fitsInBigInteger | fits_in_big_integer |
296-
| fitsInByte | fits_in_byte |
297-
| fitsInDouble | fits_in_double |
298-
| fitsInFloat | fits_in_float |
299-
| fitsInInt | fits_in_int |
300-
| fitsInLong | fits_in_long |
301-
| fitsInShort | fits_in_short |
302-
| asBigInteger | as_big_integer |
303-
| asBoolean | as_boolean |
304-
| asByte | as_byte |
305-
| asDate | as_date |
306-
| asDouble | as_double |
307-
| asDuration | as_duration |
308-
| asFloat | as_float |
309-
| asInt | as_int |
310-
| asLong | as_long |
311-
| asShort | as_short |
312-
| asString | as_string |
313-
| asTime | as_time |
314-
| asTimeZone | as_time_zone |
315-
| execute | execute |
316-
| readArrayElement | read_array_element |
317-
| getArraySize | get_array_size |
318-
| hasArrayElements | has_array_elements |
319-
| isArrayElementReadable | is_array_element_readable |
320-
| isArrayElementModifiable | is_array_element_modifiable |
321-
| isArrayElementInsertable | is_array_element_insertable |
322-
| isArrayElementRemovable | is_array_element_removable |
323-
| removeArrayElement | remove_array_element |
324-
| writeArrayElement | write_array_element |
325-
| hasIterator | has_iterator |
326-
| hasIteratorNextElement | has_iterator_next_element |
327-
| getIterator | get_iterator |
328-
| getIteratorNextElement | get_iterator_next_element |
329-
| hasHashEntries | has_hash_entries |
330-
| getHashEntriesIterator | get_hash_entries_iterator |
331-
| getHashKeysIterator | get_hash_keys_iterator |
332-
| getHashSize | get_hash_size |
333-
| getHashValuesIterator | get_hash_values_iterator |
334-
| isHashEntryReadable | is_hash_entry_readable |
335-
| isHashEntryModifiable | is_hash_entry_modifiable |
336-
| isHashEntryInsertable | is_hash_entry_insertable |
337-
| isHashEntryRemovable | is_hash_entry_removable |
338-
| readHashValue | read_hash_value |
339-
| writeHashEntry | write_hash_entry |
340-
| removeHashEntry | remove_hash_entry |
284+
| Truffle Message | Extension argument name | Expected return type |
285+
|:-------------------------|:----------------------------|-------------------------------------------------------------------------------------------|
286+
| isBoolean | is_boolean | bool |
287+
| isDate | is_date | bool |
288+
| isDuration | is_duration | bool |
289+
| isIterator | is_iterator | bool |
290+
| isNumber | is_number | bool |
291+
| isString | is_string | bool |
292+
| isTime | is_time | bool |
293+
| isTimeZone | is_time_zone | bool |
294+
| isExecutable | is_executable | bool |
295+
| fitsInBigInteger | fits_in_big_integer | bool |
296+
| fitsInByte | fits_in_byte | bool |
297+
| fitsInDouble | fits_in_double | bool |
298+
| fitsInFloat | fits_in_float | bool |
299+
| fitsInInt | fits_in_int | bool |
300+
| fitsInLong | fits_in_long | bool |
301+
| fitsInShort | fits_in_short | bool |
302+
| asBigInteger | as_big_integer | int |
303+
| asBoolean | as_boolean | bool |
304+
| asByte | as_byte | int |
305+
| asDate | as_date | a python object with the following attributes: `year`, `month`, `day` |
306+
| asDouble | as_double | float |
307+
| asDuration | as_duration | a python object with the following attributes: `seconds`, `nano_adjustment` |
308+
| asFloat | as_float | float |
309+
| asInt | as_int | int |
310+
| asLong | as_long | int |
311+
| asShort | as_short | int |
312+
| asString | as_string | str |
313+
| asTime | as_time | a python object with the following attributes: `hour`, `minute`, `second`, `microsecond` |
314+
| asTimeZone | as_time_zone | a python object with the following attributes: `tm_zone`, `tm_gmtoff` |
315+
| execute | execute | object |
316+
| readArrayElement | read_array_element | object |
317+
| getArraySize | get_array_size | int |
318+
| hasArrayElements | has_array_elements | bool |
319+
| isArrayElementReadable | is_array_element_readable | bool |
320+
| isArrayElementModifiable | is_array_element_modifiable | bool |
321+
| isArrayElementInsertable | is_array_element_insertable | bool |
322+
| isArrayElementRemovable | is_array_element_removable | bool |
323+
| removeArrayElement | remove_array_element | NoneType |
324+
| writeArrayElement | write_array_element | NoneType |
325+
| hasIterator | has_iterator | bool |
326+
| hasIteratorNextElement | has_iterator_next_element | bool |
327+
| getIterator | get_iterator | a python iterator |
328+
| getIteratorNextElement | get_iterator_next_element | object |
329+
| hasHashEntries | has_hash_entries | bool |
330+
| getHashEntriesIterator | get_hash_entries_iterator | a python iterator |
331+
| getHashKeysIterator | get_hash_keys_iterator | a python iterator |
332+
| getHashSize | get_hash_size | int |
333+
| getHashValuesIterator | get_hash_values_iterator | a python iterator |
334+
| isHashEntryReadable | is_hash_entry_readable | bool |
335+
| isHashEntryModifiable | is_hash_entry_modifiable | bool |
336+
| isHashEntryInsertable | is_hash_entry_insertable | bool |
337+
| isHashEntryRemovable | is_hash_entry_removable | bool |
338+
| readHashValue | read_hash_value | object |
339+
| writeHashEntry | write_hash_entry | NoneType |
340+
| removeHashEntry | remove_hash_entry | NoneType |
341341

342342
### Usage Example
343343

0 commit comments

Comments
 (0)