Skip to content

Commit a13a8d5

Browse files
committed
Remove the comparison-to-perl examples because several of them are buggy and don't really illustrate the behaviour
1 parent 7bb470b commit a13a8d5

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

rfcs/rfc0022.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ $bool = meta::has_package($name);
4141

4242
Returns true if the named package exists.
4343

44-
For example:
45-
46-
```perl
47-
my $bool = meta::has_package("Example::Package");
48-
# behaves as
49-
my $bool = do { no strict 'refs'; exists ${"Example::"}{"Package::"} };
50-
```
51-
5244
#### `get_package`
5345

5446
```perl
@@ -117,15 +109,6 @@ $bool = $metapackage->has_symbol($name);
117109

118110
Returns true if the named symbol exists. `$name` must begin with a sigil; one of the characters "$@%&".
119111

120-
For example:
121-
122-
```perl
123-
my $bool = meta::get_package('Example::Package')->has_symbol('$OPT');
124-
125-
# behaves as
126-
my $bool = do { no strict 'refs'; defined *{"Example::Package::OPT"}{SCALAR} };
127-
```
128-
129112
#### `get_symbol`
130113

131114
```perl
@@ -142,19 +125,6 @@ $metasymbol = $metapackage->add_symbol($name, $value);
142125

143126
Creates a new named symbol. If a value is passed it must be a reference to an item of the compatible type. If no initialisation is provided for variables, an empty variable is created. If no initialisation is provided for a subroutine then a forward declaration is created which has no body yet.
144127

145-
For example:
146-
147-
```
148-
meta::get_package('Example::Package')->add_symbol('@THINGS', [1..5]);
149-
150-
# behaves as
151-
Package::Stash->new("Example::Package")->add_symbol('@THINGS', [1..5]);
152-
153-
# or
154-
no strict 'refs';
155-
*{'Example::Package::THINGS'} = [1..5];
156-
```
157-
158128
#### `remove_symbol`
159129

160130
```perl
@@ -316,7 +286,7 @@ Some of these issues can be mitigated by careful use of the metapackage objects.
316286

317287
## Examples
318288

319-
(several examples inline in the above code. Should possibly find some more bigger use-cases and write them here.)
289+
(Should find some bigger use-cases and write them here.)
320290

321291
## Prototype Implementation
322292

0 commit comments

Comments
 (0)