Consistent terminology for attached/bound functions

This commit is contained in:
wechman
2022-12-07 19:31:41 +01:00
committed by Kamil Śliwak
parent 1c8745c54a
commit 64a4f32bc2
42 changed files with 132 additions and 133 deletions
+3 -3
View File
@@ -17,16 +17,16 @@ at contract level.
The first part, ``A``, can be one of:
- a list of file-level or library functions (``using {f, g, h, L.t} for uint;``) -
only those functions will be attached to the type.
only those functions will be attached to the type as member functions
- the name of a library (``using L for uint;``) -
all functions (both public and internal ones) of the library are attached to the type
all functions (both public and internal ones) of the library are attached to the type.
At file level, the second part, ``B``, has to be an explicit type (without data location specifier).
Inside contracts, you can also use ``using L for *;``,
which has the effect that all functions of the library ``L``
are attached to *all* types.
If you specify a library, *all* functions in the library are attached,
If you specify a library, *all* functions in the library get attached,
even those where the type of the first parameter does not
match the type of the object. The type is checked at the
point the function is called and function overload
+1 -1
View File
@@ -312,7 +312,7 @@ errorDefinition:
Semicolon;
/**
* Using directive to bind library functions and free functions to types.
* Using directive to attach library functions and free functions to types.
* Can occur within contracts and libraries and at the file level.
*/
usingDirective: Using (identifierPath | (LBrace identifierPath (Comma identifierPath)* RBrace)) For (Mul | typeName) Global? Semicolon;
+1 -1
View File
@@ -664,7 +664,7 @@ introduced type and ``V`` has to be a built-in value type (the "underlying type"
``C.wrap`` is used to convert from the underlying type to the custom type. Similarly, the
function ``C.unwrap`` is used to convert from the custom type to the underlying type.
The type ``C`` does not have any operators or bound member functions. In particular, even the
The type ``C`` does not have any operators or attached member functions. In particular, even the
operator ``==`` is not defined. Explicit and implicit conversions to and from other types are
disallowed.