Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 558 lines (382 sloc) 15.023 kb
8f67bea @fglock Perlito version 8.0
authored
1 TODO list for Perlito5
2
d6cad9b @fglock Perlito5 - TODO update
authored
3
25b8875 @fglock Perlito5 - TODO update
authored
4 * perlito5 command-line
e4641d7 @fglock Perlito - extensive TODO update
authored
5
6
8f67bea @fglock Perlito version 8.0
authored
7 * libraries
8
3004b77 @fglock Perlito5 - cleanup, update TODO
authored
9 -- these should probably go into namespace Perlito5X::*
10
ce7ce91 @fglock Perlito - TODO update
authored
11 -- Test (implemented as Perlito5::Test)
3004b77 @fglock Perlito5 - cleanup, update TODO
authored
12
ce7ce91 @fglock Perlito - TODO update
authored
13 -- Data::Dumper (implemented as Perlito5::Dumper)
8f67bea @fglock Perlito version 8.0
authored
14
24c23f7 @fglock Perlito5 - TODO update
authored
15 -- create perlito5-specific libs for:
7aeb314 @fglock Perlito5 - TODO update
authored
16 feature.pm
17 Config.pm
18 overload.pm
19 bytes.pm
20 integer.pm
21 lib.pm
22 Carp.pm
23 Tie::Array
24 Tie::Hash
25 Tie::Scalar
853e867 @fglock Perlito5 - perl5 - format <glob>
authored
26 Symbol
24c23f7 @fglock Perlito5 - TODO update
authored
27
4d56b5d @fglock Perlito5 - add $ENV{PERL5LIB} to @INC
authored
28 alternately, check $^H for strictness - such that perl's own strict.pm just works
29 and ${^WARNING_BITS} for warnings
30
8f67bea @fglock Perlito version 8.0
authored
31
7b982c3 @fglock Perlito5 - update TODO
authored
32 * Parser
33
2537119 @fglock Perlito5 - TODO update
authored
34 -- "'" meaning "::"
35 $'m # $::m
36 $m' # String found where operator expected
37
38 package X'Y # X::Y
39 package X' # Invalid version format (non-numeric data)
40
131944d @fglock Perlito5 - TODO update; add more references to documentation and tests
authored
41 -- attributes
42 http://perldoc.perl.org/attributes.html
c2716c0 @fglock Perlito5 - parser - subroutine attributes
authored
43 missing MODIFY_CODE_ATTRIBUTES handlers
02db591 @fglock Perlito5 - update TODO
authored
44
131944d @fglock Perlito5 - TODO update; add more references to documentation and tests
authored
45 -- create __DATA__
2547cec @shlomif Remove trailing space.
shlomif authored
46 %Perlito5::DATA_SECTION contains the __DATA__ for each package
5058d24 @fglock Perlito5 - grammar - save __DATA__ sections
authored
47
ae33743 @fglock Perlito5 - TODO update
authored
48 -- compile-time eval() is not bound to the "program" environment, but to the "compiler" environment instead
131944d @fglock Perlito5 - TODO update; add more references to documentation and tests
authored
49 see README-perlito5-js near "Compile-time / Run-time interleaving"
50
51 my $v;
52 BEGIN { $v = "123" }
53 use Module $v; # $v is not accessible at compile-time
7b982c3 @fglock Perlito5 - update TODO
authored
54
529225f @fglock Perlito5 - TODO update
authored
55 -- parse the regexes
131944d @fglock Perlito5 - TODO update; add more references to documentation and tests
authored
56 create an AST for regexes
7b982c3 @fglock Perlito5 - update TODO
authored
57
b32dc90 @fglock Perlito5 - update TODO
authored
58 -- prototypes (signatures)
131944d @fglock Perlito5 - TODO update; add more references to documentation and tests
authored
59 http://perldoc.perl.org/perlsub.html#Prototypes
60
61 check that undeclared barewords give the right error
62 *foo = sub () { ... } # does prototype work here?
63 check signature in sort()
64 fix the prototype for 'stat(*)' (see t/test.pl in the perl test suite)
fde5276 @fglock Perlito5 - update TODO
authored
65
880ba6e @fglock Perlito5 - TODO update
authored
66 '&@' - See Try::Tiny
67
5f528ed @fglock Perlito5 - parser - more TODO special cases
authored
68 -- "namespace" parsing
131944d @fglock Perlito5 - TODO update; add more references to documentation and tests
authored
69 tests: t5/01-perlito/26-syntax-namespace.t
5f528ed @fglock Perlito5 - parser - more TODO special cases
authored
70
e107c18 @fglock Perlito5 - parser - add "glob variable"
authored
71 $ perl -e ' { package X; sub print { CORE::print(">$_[1]<\n") } } my $x = bless {}, "X"; print $x "xxx" '
72 Not a GLOB reference at -e line 1.
73
74 $ perl -e ' { package X; sub printx { CORE::print(">$_[1]<\n") } } my $x = bless {}, "X"; printx $x "xxx" '
75 >xxx<
76
77 $ perl -MO=Deparse -e ' print X:: "xxx" '
78 print X 'xxx';
79
80 $ perl -e ' use strict; my $x = X::; print $x '
81 X
82
83 $ perl -e ' use strict; my $x = X; print $x '
2547cec @shlomif Remove trailing space.
shlomif authored
84 Bareword "X" not allowed while "strict subs" in use
e107c18 @fglock Perlito5 - parser - add "glob variable"
authored
85
daea592 @fglock Perlito5 - add more "use strict"
authored
86 $ perl perlito5.pl -MO=Deparse -e ' ::X::x::y '
87 join("", ::{'main::X::'} x main::y);
88
5f528ed @fglock Perlito5 - parser - more TODO special cases
authored
89 $ perl -MO=Deparse -e ' ::X '
90 '???';
91
92 $ perl -MO=Deparse -e ' sub X {} ::X '
93 sub X { }
94 X;
95
d216d0e @fglock Perlito5 - parser - namespace TODO - more corner cases
authored
96 $ perl -e ' $::X::::X = 3; print $main::X::::X ' # 3
d69c95a @fglock Perlito5 - parser - namespace TODO - more corner cases
authored
97 $ perl -e ' $::X::::X = 3; print $main::main::X::::X ' # 3
98 $ perl -e ' $::X::::X = 3; print $main::X::main::X ' # empty
d216d0e @fglock Perlito5 - parser - namespace TODO - more corner cases
authored
99 $ perl -e ' $::X::::X = 3; print $main::X::X ' # empty
d69c95a @fglock Perlito5 - parser - namespace TODO - more corner cases
authored
100 $ perl -e ' $::X::::X = 3; print $::::X::::X ' # empty
101
bad489f @fglock Perlito5 - parser - TODO list
authored
102 -- CORE:: namespace can be used with operators:
103
104 $ perl -MO=Deparse -e ' $x CORE::and $v '
105 $v if $x;
106
107 $ perl -MO=Deparse -e ' @v = CORE::qw/ a b c / '
108 @v = ('a', 'b', 'c');
109
110 $ perl -MO=Deparse -e ' $x CORE::+ $v '
111 CORE:: is not a keyword
112
d216d0e @fglock Perlito5 - parser - namespace TODO - more corner cases
authored
113
1395266 @fglock Perlito5 - TODO update
authored
114 -- strict and warnings: create options like 'subs', 'refs'
115
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
116 -- things that work in perlito5, but which are errors in 'perl'
117
30e4683 @fglock Perlito5 - TODO update
authored
118 $ perl -e ' my @things= map { no warnings; 123 } @list; '
119 "no" not allowed in expression
120
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
121 quotes vs. hash lookups:
2547cec @shlomif Remove trailing space.
shlomif authored
122
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
123 $ perl -e ' q}} '
124 # ok
2547cec @shlomif Remove trailing space.
shlomif authored
125
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
126 $ perl -e ' $x{ q}} } '
127 Unmatched right curly bracket at -e line 1, at end of line
2547cec @shlomif Remove trailing space.
shlomif authored
128
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
129 $ perl -e ' $x{ q]] } '
130 # ok
2547cec @shlomif Remove trailing space.
shlomif authored
131
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
132 string interpolation with nested quotes of the same type:
2547cec @shlomif Remove trailing space.
shlomif authored
133
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
134 $ perl -e ' " $x{"x"} " '
135 String found where operator expected at -e line 1, near "x"} ""
136
2cc1933 @fglock Perlito5 - TODO update
authored
137
95e6b6c @fglock Perlito5 - TODO cleanup
authored
138 * Add tests for fixed bugs:
139
efea5bc @fglock Perlito5 - TODO update
authored
140 ---
188a125 @fglock Perlito5 - js - resolve filehandle methods
authored
141 resolve "filehandle" methods
142
143 $ perl -e ' package X; open(X, ">", "x"); X->print(1234) '
144 $ cat x
145 1234
146 $ nodejs perlito5.js -Isrc5/lib -Cjs -e ' package X; open(X, ">", "x"); X->print(1234) '
147
148
149 ---
efea5bc @fglock Perlito5 - TODO update
authored
150 variable declarations in expressions
151
152 our $Verbose ||= 0;
153 our (%Cache);
154 my $args = @_ or @_ = @$exports;
155
95e6b6c @fglock Perlito5 - TODO cleanup
authored
156
157 ---
158 add additional variants of "for"
159
160 # "our" with localization
161 $ perl -e ' use strict; our $x = 123; for our $x (1,2,3) { 2 } print "$x\n" '
162 123
163
164 # variable in scope with localization
165 $ perl -e ' use strict; my $x = 123; for $x (1,2,3) { 2 } print "$x\n" '123
166 123
167
168
169 ---
170 add "print", "printf", "say" special parsing - note this is related to indirect object notation
171
172 indirect object notation
173 http://lwn.net/Articles/451486/
174 http://www.modernperlbooks.com/mt/2009/08/the-problems-with-indirect-object-notation.html
175 http://shadow.cat/blog/matt-s-trout/indirect-but-still-fatal/
176 http://perlbuzz.com/mechanix/2008/02/the-perils-of-perl-5s-indirect.html
177
178 method Module $param;
179 new Class( arg => $value );
180 new Class::($args);
181 say $config->{output} "This is a diagnostic message!"; # indirect call
182 say {$config->{output}} "This is a diagnostic message!"; # say to filehandle
183
184 use Class;
185 sub Class {
186 warn 'Called Class sub not Class package';
187 'Class'
188 }
189 my $q = Class->new; # calls the Class sub above
190 my $s = new Class; # throws a 'Bareword found where operator expected' error
191 my $t = Class::->new # this works
192 my $u = new Class::; # this also works (even with sub main in the current package)
193
194 sbertrang++ noted this is also valid:
195 print( STDERR "123" )
196
197
198 ---
94163c8 @fglock perlito5 - parser - tweak TODO list
authored
199 add tests for signatures: "empty" _ $ ;$
200
201 ---
caf3b30 @fglock perlito5 - parser - fix "sub _" should be in package "main"
authored
202 add test for "sub _" should be in package "main"
203 $ perl -MO=Deparse -e ' package X; sub _ { 123 } '
204 package X;
205 sub main::_ {
206 123;
207 }
208
209 ---
210 add test for defined-or vs. m// (2012/9/25 Конрад Боровски <notifications@github.com>)
211 Note: fixed; see test t5/01-perlito/25-syntax-defined-or.t
212
213 $ perl perlito5.pl -Isrc5/lib -Cast-perl5 -e ' shift // 2 '
214 Number or Bareword found where operator expected
215
216 $ perl perlito5.pl -Isrc5/lib -Cast-perl5 -e ' shift / 2 '
217 Can't find string terminator '/' anywhere before EOF
218
219 ---
220 add test for filetest operators special case:
2cc1933 @fglock Perlito5 - TODO update
authored
221 ' -f($file).".bak" ' should be equivalent to -f "$file.bak"
2547cec @shlomif Remove trailing space.
shlomif authored
222 parses as -(f($file)).".bak"
2cc1933 @fglock Perlito5 - TODO update
authored
223 but: ' -f ($file).".bak" '
224 parses correctly
225 This seems to be because there is a rule that \w followed by '(' is a function call;
226 this needs more testing: ' ... and(2) '
dd7a160 @fglock Perlito5 - parser: fix a bug caused by incorrect is_term state
authored
227 Test: redefine 'and', 'not' and check what works.
2cc1933 @fglock Perlito5 - TODO update
authored
228
229 ' $s111++ + $s222 '
230 parses as (+$s222)++
231
dd7a160 @fglock Perlito5 - parser: fix a bug caused by incorrect is_term state
authored
232 ' $step++ < $steps '
233 Can't find string terminator '>' anywhere before EOF
234
c701f67 @fglock Perlito5 - grammar - alfanumeric quoting delimiters
authored
235 -- from moritz, Schwern and others at
236 http://stackoverflow.com/questions/161872/hidden-features-of-perl
237
238 - you can use letters as delimiters
239
240 $ perl -Mstrict -wle 'print q bJet another perl hacker.b'
241 Jet another perl hacker.
2547cec @shlomif Remove trailing space.
shlomif authored
242
c701f67 @fglock Perlito5 - grammar - alfanumeric quoting delimiters
authored
243 Likewise you can write regular expressions:
2547cec @shlomif Remove trailing space.
shlomif authored
244
c701f67 @fglock Perlito5 - grammar - alfanumeric quoting delimiters
authored
245 m xabcx
246 # same as m/abc/
247
2cc1933 @fglock Perlito5 - TODO update
authored
248
8f67bea @fglock Perlito version 8.0
authored
249
8dbed68 @fglock Perlito5 - perl6 - TODO list
authored
250 * Perl6 backend
251
b1c054d @fglock Perlito5 - TODO update
authored
252 -- keep comments
253
52a4c4c @fglock Perlito5 - perl6 - wantarray discussion
authored
254 -- context: wantarray, return-comma
255 sub x { return 7, 8 }
256 vs. sub x { return (7, 8) }
257
258 use an "out-of-band" parameter to set the call context, like:
259 $v = x( :scalar ) # 8
260 $v = x( :list ) # 2
261
2120983 @fglock Perlito5 - perl6 - TODO list; special variables fix
authored
262 -- <> is lines()
263
c022193 @fglock Perlito5 - perl6 - TODO update
authored
264 -- 0..$#num to @num.keys
265
2120983 @fglock Perlito5 - perl6 - TODO list; special variables fix
authored
266 -- choose @*ARGS or @_ in shift() and pop()
267
268 -- typeglob assignment
269
8dbed68 @fglock Perlito5 - perl6 - TODO list
authored
270 -- "given" statement not implemented
271
272 -- refactoring sub arguments
273 my $x = $_[0];
274 my ($x, $y, @rest) = @_; # check if @_ is unused elsewhere in the sub
275
2120983 @fglock Perlito5 - perl6 - TODO list; special variables fix
authored
276 -- placeholder
277 my ($a, $, $c) = 1..3;
278 ($a, *, $c) = 1..3;
279
8dbed68 @fglock Perlito5 - perl6 - TODO list
authored
280 -- __PACKAGE__
281
282 -- specialized refactoring for packages that introduce syntax
283 Try::Tiny
284 List::MoreUtils
285 Moose
286
287 -- no strict
288
289 -- bless
290
291 -- tests
292
293
294
5bb50dd @fglock Perlito5 - update TODO
authored
295 * Perl5 backend
399a3d2 @fglock Perlito5 - use scalar() instead of .elems()
authored
296
7bc739e @fglock Perlito5 - parser - add 'Perlito5::AST::Given'
authored
297 -- "given" statement not implemented
376e088 @fglock Perlito5 - TODO update
authored
298 -- "default" statement not implemented
7bc739e @fglock Perlito5 - parser - add 'Perlito5::AST::Given'
authored
299
529225f @fglock Perlito5 - TODO update
authored
300 -- ${^NAME} needs curly-escaping
301
2547cec @shlomif Remove trailing space.
shlomif authored
302 - fix regex delimiters, or escape the regexes
85c5759 @fglock Perlito5 - TODO update
authored
303
7a5d100 @fglock Perlito5 - perl5: document emitter bug (significant parenthesis)
authored
304
0cc64c5 @fglock Perlito5 - kill perl6-ish "method"
authored
305
8f67bea @fglock Perlito version 8.0
authored
306 * Javascript backend
307
629bbbe @fglock Perlito5 - TODO update
authored
308 -- constant subroutines
309 -- prototype mismatch
310 $ perl -e ' sub X () { 123 } print X, "\n"; eval " sub X { 456 } "; '
311 123
312 Prototype mismatch: sub main::X () vs none at (eval 1) line 1.
313 Constant subroutine X redefined at (eval 1) line 1.
173897c @fglock Perlito5 - js - TODO - phase order
authored
314
55096c6 @fglock Perlito5 - TODO update
authored
315 -- reference to scalar doesn't work
316 $ node perlito5.js -Isrc5/lib -I. -e ' use Data::Dumper; $v = [20, \$v ]; print Dumper ($v) '
317 $VAR1 = [
318 20,
319 \undef,
320 ];
321
322 -- indirect object is confused here, maybe a problem at import() time:
323 $ node perlito5.js -Isrc5/lib -I. -e ' use Data::Dumper; $v = [20, \$v ]; print Dumper $v '
324 Warning: Died: Can't call method Dumper on unblessed reference
325
173897c @fglock Perlito5 - js - TODO - phase order
authored
326 -- phase order
327 print x(); # js will try to execute this before the sub declaration
328 sub x { "ok\n"; }
329 # TypeError: Object [object Object] has no method 'x'
330
4d5d7c5 @fglock Perlito5 - parser - VSTRING tweak
authored
331 -- dot-decimal strings / v-strings
880ba6e @fglock Perlito5 - TODO update
authored
332 5.4.66.77
333 v5.4.66.77
334
335 $ perl -e ' my $v = 5.4.66.77 ; print $v, "\n"; require $v '
336 BM
337
1e00896 @fglock Perlito5 - require+version
authored
338 -- 'require v5.006;'
339 # Can't locate v5.006 in @INC
945df32 @fglock Perlito5 - TODO update
authored
340
4e24602 @fglock Perlito5 - TODO update
authored
341 -- assign old-self to my / local
342 local $Some_Global = $Some_Global;
343
fa46927 @fglock Perlito5 - js - TODO update
authored
344 -- missing some types of subroutine signatures
21af3dc @fglock Perlito5 - js - TODO update
authored
345 -- '&' prototype
346 add tests; see Try::Tiny
347
348 -- AUTOLOAD() called from UNIVERSAL autovivifies packages
349 add tests
350
09cc8db @fglock Perlito5 - js - add TODO for delete() special case
authored
351 -- delete() in the middle of an array turns exists() off:
352
353 $ perl -e ' @a = (3..7); delete $a[2]; print "exists ", (exists $a[$_] ? 1 : 0), "\n" for 0 .. $#a '
354 exists 1
355 exists 1
356 exists 0
357 exists 1
358 exists 1
359
8dda686 @fglock Perlito5 - string parser flags \E \L \U \Q (more)
authored
360 -- delete() in src5/lib/Perlito5/Grammar/String.pm doesn't seem to work:
361 delete($quote_flags->{$flag_to_reset});
362 delete($quote_flags->{last_flag});
363
ecbc8f4 @fglock Perlito5 - TODO update; fix "when"
authored
364 -- "~~" operator not implemented; See also "when" implementation
365 -- "given" statement not implemented
376e088 @fglock Perlito5 - TODO update
authored
366 -- "when" should use a "break" exception inside "given", and a "next" exception inside "for".
ecbc8f4 @fglock Perlito5 - TODO update; fix "when"
authored
367 -- "default" statement not implemented
368
9f9d0dd @fglock Perlito5 - javascript: TODO update
authored
369 -- javascript errors don't show in the global error handler when running in node.js
7a03ff4 @fglock Perlito5 - javascript: eval-block works
authored
370
1b95122 @fglock Perlito5 - TODO update
authored
371 -- "autoload" the compiler if eval-string or require() are used (eval-string needs the compiler at run-time)
372 https://github.com/fglock/Perlito/issues/23
e584da6 @fglock Perlito5 - javascript: TODO update
authored
373
529225f @fglock Perlito5 - TODO update
authored
374 -- symbol variables like $] ${"main::\$"} $#_
375 -- check that @_, $_, $a, $b and other special variables are in the right context (lexical, global, package global)
376
014a584 @fglock Perlito5 - javascript: working @ISA; update Changelog, examples
authored
377 -- add alternate mro's
85c5759 @fglock Perlito5 - TODO update
authored
378 -- cache the mro
42a3449 @fglock Perlito5 - TODO update
authored
379
380 -- add regex compiler
381 -- /e modifier
d2169b7 @fglock Perlito5 - t/test.pl: use cmp_ok()
authored
382 -- /x modifier
42a3449 @fglock Perlito5 - TODO update
authored
383 -- support all perl5 regex syntax
529225f @fglock Perlito5 - TODO update
authored
384 -- @v = /x/g
42a3449 @fglock Perlito5 - TODO update
authored
385
20a798b @fglock Perlito5 - js TODO - regex variables localization in blocks
authored
386 -- regex variables localization in blocks
387 $ perl -e ' "a" =~ /(.)/; print $1; { "b" =~ /(.)/; print $1; } print $1, "\n"; '
388 aba
389 $ perl -e ' "a" =~ /(.)/; print $1; { "b" =~ //; print $1; } print $1, "\n"; '
390 abb
391 $ perl -e ' "a" =~ /(.)/; print $1; { "b" =~ /x/; print $1; } print $1, "\n"; '
392 aaa
393
78ae779 @fglock Perlito5 - regex TODO - more qr() details
authored
394 -- some qr() and quotemeta() details
c7c242d @fglock Perlito5 - regex TODO - some qr() details
authored
395
396 $ perl -e ' my $x = qr/ \A x /x; my $y = qr/$x y \Q[z]/; use Data::Dumper; print Dumper $x; print Dumper $y; '
397 $VAR1 = qr/(?x-ism: \A x )/;
398 $VAR1 = qr/(?-xism:(?x-ism: \A x ) y \[z\])/;
399
78ae779 @fglock Perlito5 - regex TODO - more qr() details
authored
400 $ perl -e ' print " a b \Q [ a \nn"; '
401 a b \ \[\ a\ \
402 n
403
4242a67 @fglock Perlito5 - string parser flags \E \L \U \Q
authored
404 $ perl -e ' print "x\Q[\Qx]\Ex\n" '
405 x\[x\\\]x\ # '\' is quoted, but 'Q' disappears
406
6cf47b4 @fglock Perlito5 - TODO update
authored
407 -- qr() returns a Regexp object
408 {
409 package Regexp;
410 sub x { 123 }
411 }
412 $a = qr//;
413 print $a->x, "\n"; # 123
414
887219b @fglock Perlito5 - javascript: work around variable redeclaration bug
authored
415 -- bug: variable redeclaration does not work
416 -- javascript "var" erases the outer value within the whole current lexical scope
42a3449 @fglock Perlito5 - TODO update
authored
417 -- bug: "my" variables - this doesn't work as expected: my $v = $v
418 possible fix: rename variables
efe33bd @fglock Perlito5 - js - TODO update
authored
419 possible fix: initialize variables to null
420 -- add tests using closures, to check that the redeclared variable is a different variable
421 $ perl -e ' my $x = 10; print "$x\n"; my $x; print "$x\n"; '
422 10
423 [space]
424 $ nodejs perlito5.js -Isrc5/lib -e ' my $x = 10; print "$x\n"; my $x; print "$x\n"; '
425 10
426 10
887219b @fglock Perlito5 - javascript: work around variable redeclaration bug
authored
427
b75827a @fglock Perlito5 - TODO update
authored
428 -- lvalue ternary: ($a_or_b ? $a : $b) = $c;
429 -- lvalue substr()
430 -- 4-arguments substr()
b1c054d @fglock Perlito5 - TODO update
authored
431 -- lvalue pos($str)
78fd976 @fglock Perlito5 - javascript: fix 3-arguments substr()
authored
432 -- pos($str)
b44f592 @fglock Perlito5 - TODO update
authored
433 -- lvalue chomp(), chop()
b1c054d @fglock Perlito5 - TODO update
authored
434 -- lvalue $#a
435 -- lvalue subroutine
78fd976 @fglock Perlito5 - javascript: fix 3-arguments substr()
authored
436
8f67bea @fglock Perlito version 8.0
authored
437 -- bug: variable aliases create copies instead
efe33bd @fglock Perlito5 - js - TODO update
authored
438 for (@x) { $_++ } # doesn't change @x
8f67bea @fglock Perlito version 8.0
authored
439
ce36bd0 @fglock Perlito5 - update TODO
authored
440 -- generate more compact code; maybe use more subroutines instead of inlining;
441 autovivification is probably the most verbose part of the code.
1b95122 @fglock Perlito5 - TODO update
authored
442 Use less "throw" - it is not (yet?) optimized by V8
ae7ad72 @fglock Perlito5 - update docs
authored
443
7b982c3 @fglock Perlito5 - update TODO
authored
444 -- in the browser: implement "use" with XMLHttpRequest (what are the security implications?)
4b15a00 @fglock Perlito5 - cleanup parenthesis
authored
445
1b4e7ee @fglock Perlito5 - TODO update: typeglobs
authored
446 -- aliasing between lexicals and globals
447 $ perl -e 'use strict; my $x = 3; *main::z = \$x; print $main::z; '
448 3
5bb50dd @fglock Perlito5 - update TODO
authored
449
0e5b55f @fglock Perlito5 - update TODO
authored
450 -- finish "overload" implementation
1c44abc @fglock Perlito5 - TODO - update
authored
451 See: p5str
0e5b55f @fglock Perlito5 - update TODO
authored
452
0718f37 @fglock Perlito5 - javascript: TODO update
authored
453 -- pack(), unpack()
454
b343129 @fglock Perlito - TODO update
authored
455 -- BEGIN{} should execute in the environment of the program under compilation
88914e1 @fglock Perlito5 - TODO update
authored
456 -- BEGIN/END that are defined inside blocks/closures need to run inside some pseudo-environment
457 even if the closure was never created or used in the first place
b343129 @fglock Perlito - TODO update
authored
458
9643c62 @fglock Perlito5 - TODO update
authored
459 -- flip-flop operator
460 if either operand to scalar '..' is a constant the value is implicitly compared to the input line number ($.)
461
fa46927 @fglock Perlito5 - js - TODO update
authored
462
463 * Javascript - implemented but missing more tests
464
efe33bd @fglock Perlito5 - js - TODO update
authored
465 -- add symbol tables for scalar, array and hash
466 -- references to typeglobs:
467 $ perl -e ' print ref(\*main) '
468 GLOB
469
fa46927 @fglock Perlito5 - js - TODO update
authored
470 -- prototype() can be set by aliasing:
471 *x = sub ($$) { 123 }; *y = *x; print prototype(\&y) # $$
472
473 -- "or" has SCALAR context (Abigail++):
474 See: t5/01-perlito/23-eval.t
475
476 -- 'next', 'last' in expression
477 (*{"${callpkg}::$sym"} = \&{"${pkg}::$sym"}, next)
478 ... ) and last
479
480 -- check that \(@a) and \@a have different meanings
481
482 -- 'x' in list context
483 @{$cache}{@$ok} = (1) x @$ok;
484
485 -- while () {}
486 this is implemented - it now needs some tests:
487 # http://blogs.perl.org/users/peter_martini/2014/05/spelunking-why-while-is-my-new-favorite-perl-ism.html
488 while () {} # infinite loop - while(1)
489 while (()) {} # no loop
490
491 -- pass @_ to &sub
492 $ node perlito5.js -I./src5/lib -Cjs -e ' @_ = (1,2); &foo; '
493 # call foo(@_)
494
495
fb9190c @fglock Perlito5 - TODO update
authored
496 * Nice to Have
a7ab071 @fglock Perlito5 - add TODO
authored
497
b1c054d @fglock Perlito5 - TODO update
authored
498 -- keep comments
499
3c87580 @fglock Perlito - TODO update
authored
500 -- debugging symbols
501 -- line numbers in error messages
502
8f60cb4 @fglock Perlito5 - TODO update
authored
503 -- caller()
504 -- "when"
465ee11 @fglock Perlito5 - TODO update
authored
505
fb9190c @fglock Perlito5 - TODO update
authored
506 -- run more of the "perl" test suite
0cc64c5 @fglock Perlito5 - kill perl6-ish "method"
authored
507
71b0905 @fglock Perlito5 - docs update
authored
508 -- proper "use strict" and "use warnings"
1b2eecc @fglock Perlito5 - use @ARGV instead of @*ARGS
authored
509 -- use the same error messages and warnings as 'perl'
42a3449 @fglock Perlito5 - TODO update
authored
510 -- no warnings 'redefine';
1b2eecc @fglock Perlito5 - use @ARGV instead of @*ARGS
authored
511
ebce10f @fglock Perlito5 - parser: add __END__, __DATA__
authored
512 -- __LINE__, __FILE__
f4910a7 @fglock Perlito5 - TODO update
authored
513
b343129 @fglock Perlito - TODO update
authored
514 -- INIT{}, END{}
515 look at the implementation in perlito6-in-Go
f4910a7 @fglock Perlito5 - TODO update
authored
516
4b15a00 @fglock Perlito5 - cleanup parenthesis
authored
517 -- source code - remove Perl 6 code such as "token"
71b0905 @fglock Perlito5 - docs update
authored
518 (fixed: This is only loaded if the grammar compiler is needed)
4b15a00 @fglock Perlito5 - cleanup parenthesis
authored
519
61d64aa @fglock Perlito5 - parser: rewrite operator() in "perl5-land" for later tweaking
authored
520 -- *{ $name }{CODE}->();
521
522 -- local(*{$caller."::a"}) = \my $a;
6217752 @fglock Perlito5 - docs update
authored
523 -- *{$pkg . "::foo"} = \&bar;
61d64aa @fglock Perlito5 - parser: rewrite operator() in "perl5-land" for later tweaking
authored
524
bb0befb @fglock Perlito5 - 'local' now works with subscripted variables
authored
525 -- local $SIG{__WARN__};
526
efe33bd @fglock Perlito5 - js - TODO update
authored
527 -- bug https://github.com/fglock/Perlito/issues/10
528 "Perlito 5 JS has syntax errors"
529
530 Tried
531
532 YUI Compressor online
533 and
534 Google Closure Compiler
535 http://closure-compiler.appspot.com/home
536
537 Both failed with syntax errors.
538
61d64aa @fglock Perlito5 - parser: rewrite operator() in "perl5-land" for later tweaking
authored
539
9643c62 @fglock Perlito5 - TODO update
authored
540 * Oddities
541
542 -- from moritz, Schwern and others at
543 http://stackoverflow.com/questions/161872/hidden-features-of-perl
544
545 - you can give subs numeric names if you use symbolic references
546
547 $ perl -lwe '*4 = sub { print "yes" }; 4->()'
548 yes
549
d6cad9b @fglock Perlito5 - TODO update
authored
550
551 * Deprecate
552
553 -- Interpreter backend
554 this is not being maintained; the code is still in src5/lib/Perlito5/Eval.pm just in case
555
b1c054d @fglock Perlito5 - TODO update
authored
556 alternately, use the interpreter to compute constant foldings
557
Something went wrong with that request. Please try again.