Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 deletions
9
Task/Scope-modifiers/Erlang/scope-modifiers.erl
Normal file
9
Task/Scope-modifiers/Erlang/scope-modifiers.erl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
-module( a_module ).
|
||||
|
||||
-export( [double/1] ).
|
||||
|
||||
double( N ) -> add( N, N ).
|
||||
|
||||
|
||||
|
||||
add( N, N ) -> N + N.
|
||||
14
Task/Scope-modifiers/Logtalk/scope-modifiers.logtalk
Normal file
14
Task/Scope-modifiers/Logtalk/scope-modifiers.logtalk
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
:- public(foo/1). % predicate can be called from anywhere
|
||||
|
||||
:- protected(bar/2). % predicate can be called from the declaring entity and its descendants
|
||||
|
||||
:- private(baz/3). % predicate can only be called from the declaring entity
|
||||
|
||||
:- object(object, % predicates declared in the protocol become private for the object
|
||||
implements(private::protocol)).
|
||||
|
||||
:- category(object, % predicates declared in the protocol become protected for the category
|
||||
implements(protected::protocol)).
|
||||
|
||||
:- protocol(extended, % no change to the scope of the predicates inherited from the extended protocol
|
||||
extends(public::minimal)).
|
||||
Loading…
Add table
Add a link
Reference in a new issue