Hello everybody,
I'm about to rewrite major parts of one of my projects (currently
written in C); because of that rewrite I'm thinking about using
perl6 for the most parts, and write only the most performance
sensitive parts in C.
I was just on #perl6, and got the tip to write a feature request
Having read all of this thread to date, I'll state a solution which should be
elegant and which I'm not sure has been stated yet.
I propose that the concept of current working directory in Perl be a
completely internal, virtual concept, and each Perl thread has its own current
working
All this discussion about file paths, particularly about current working
directory, has inspired me to raise another idea for how this could be done,
which may be a little more abstract or different than you're used to, but may
also be an elegant solution.
My proposal draws inspiration from a
# New Ticket Created by Hanno Hecker
# Please include the string: [perl #68662]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=68662
$ uname -a
Linux hex 2.6.26-2-amd64 #1 SMP Sun Jul 26 20:35:48 UTC 2009 x86_64
I think this is a much more flexible system than those suggested so far.
It seems to me that this approach
- lets the OS and the implementation deal with pathways that are valid
(taking into account locale and OS constraints).
- defines only that part of the location/directory tree/file system
# New Ticket Created by Hanno Hecker
# Please include the string: [perl #68664]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=68664
$ ./perl6 -e 'class A {
has $.a is rw;
method add (A $b) { $.a ~ $b.a }
}
On Wed, Aug 19, 2009 at 2:35 AM, Darren Duncan dar...@darrenduncan.netwrote:
Having read all of this thread to date, I'll state a solution which should
be elegant and which I'm not sure has been stated yet.
I think that's basically what we were suggesting above, except:
(If Perl really
Very interesting read, that opens a whole new can of worms. How should we
behave when we actually read file names from the filesystem.
As for the path literal the newest revision of S32-setting-library should make
most people happy as the default is OS independent and abstract. More
strictness
On Mon Jun 29 21:04:59 2009, KyleHa wrote:
On Sun Jan 11 11:39:10 2009, moritz wrote:
I leave this ticket open to remind everybody that this needs to be
implemented.
The test for this is passing now. Can this ticket be closed?
Indeed it can. Closing.
Thanks,
Jonathan
On Mon May 04 06:27:17 2009, masak wrote:
masak rakudo: class A {}; class B hides A {}
p6eval rakudo 0588e8: OUTPUT«Unable to parse class definition at
line 1, near hides A {} [...]
* masak submits TODO rakudobug
jnthn wtf is hides?
masak S12:1716
OMG implemented! Plus test in
On Fri May 08 05:03:12 2009, masak wrote:
masak rakudo: sub a { outer }; { my sub a { inner }; say a }; say a
p6eval rakudo dc680c: OUTPUT«outerouter»
jnthn fail :-(
jnthn .oO( thanks Parrot... )
Thanks to a fix in Parrot, this now works. Assigning to moritz++ for
spectest.
Thanks,
On Wed, 19 Aug 2009, Darren Duncan wrote:
My proposal is to have all filesystem paths as seen within Perl being
relative paths, and that there are multiple filesystem roots which can be
referred to by name and each relative path is explicitly relative to a named
root; each of these named
On Mon May 11 07:26:22 2009, masak wrote:
Tene jnthn: I ran into an awkward bug last night...
jnthn Tene: Bug being? (will be able to focus on Rakudo stuff in ~
10-15 minutes)
Tene jnthn: I used a sub trait handler to stuff a block into an
array. When I then tried to return something from
On Tue May 19 06:04:42 2009, masak wrote:
masak rakudo: class A { method postcircumfix:( )() { 42 } }; my $a
= A.new; say $a()
p6eval rakudo 222993: OUTPUT«invoke() not implemented in class 'A [...]
Matt-W masak: awww
masak Matt-W: so close! :/
moritz_ ticket it!
Matt-W I guess it's not
On Sun Jan 25 07:41:03 2009, masak wrote:
masak TimToady: sometimes I'm unhappy about how restrictive the
'class Foo;' syntax is. the idea is very sound, to remove a level of
indentation that encompasses practically the whole file. but I can't
do 'class Foo is Bar;', because there's no way to
# New Ticket Created by Moritz Lenz
# Please include the string: [perl #68672]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=68672
Rakudo 8e0b7409d757fa938f0a3176a192291a8e9e3996:
$ perl6 -e '1 ?? 1;'
On Wed Apr 08 14:59:19 2009, moritz wrote:
23:55 @moritz_ rakudo: my @a = 1..4; say @a[1..*].perl
23:56 p6eval rakudo 6b9755: OUTPUT«[2, 3, 4, undef]»
It should just be [2, 3, 4].
Since the discussion came up on #perl6 if this is really the expected
behaviour, S09 says:
As the end-point
On Wed, Aug 19, 2009 at 1:54 PM, Moritz Lenz via RT
perl6-bugs-follo...@perl.org wrote:
Since the discussion came up on #perl6 if this is really the expected
behaviour, S09 says:
As the end-point of a range, a lone whatever means to the maximum
specified index (if fixed indices were
On Sun Jul 12 10:56:35 2009, moritz wrote:
Rakudo: 08928df70e4af4013eb0bfde02256262728ecf6e
$ perl6 -e 'my @a = elems join; say @a...@a()'
Cannot use .* when method is a code ref at line 1, near
in Main (src/gen_setting.pm:1334)
This is rather unhelpful to me since I see no code refs
On Wed, Aug 19, 2009 at 5:37 AM, Jan Ingvoldstadfrett...@gmail.com wrote:
On Wed, Aug 19, 2009 at 1:54 PM, Moritz Lenz via RT
perl6-bugs-follo...@perl.org wrote:
Since the discussion came up on #perl6 if this is really the expected
behaviour, S09 says:
As the end-point of a range, a lone
On Wed Apr 22 09:57:06 2009, masak wrote:
cspencer rakudo: our Int sub foo() { return fail() }; foo()
p6eval rakudo 04ee8d: OUTPUT«Type check failed on return value [...]
cspencer should a fail() fail a type check in this case?
jnthn For upper-case types, I think not...
jnthn report as
On Mon Jan 26 06:45:24 2009, masak wrote:
masak rakudo: ord(); say Alive
p6eval rakudo 36030: OUTPUT«Cannot get character of empty string [...]
masak should Rakudo really die here?
* masak thinks not
moritz_ I think it should fail()
[particle] return a Failure
[particle] see what perl 5
On Sun Sep 07 10:29:52 2008, pmichaud wrote:
For rakudo builtin functions that are written in PIR, use
.return '!FAIL'('...message...')
instead of the old-style
$P0 = new 'Failure'
.return ($P0)
Thanks to those who contributed patches towards this effort. I've just
hunted
On Sun Feb 01 09:27:58 2009, masak wrote:
masak rakudo: package A {}; A::method_that_does_not_exist
p6eval rakudo 36249: OUTPUT«Null PMC access in invoke() [...]
* masak reports rakudobug
Resolved in git 33e3839 and unfudged tests.
Thanks,
Jonathan
On Wed Mar 04 12:20:07 2009, matt-w wrote:
20:12 Matt-W rakudo: sub foo { EN::a; }; say alive; foo;
20:12 p6eval rakudo 33ddc7: OUTPUT«aliveNull PMC access in
invoke()current
instr.: 'foo' pc 130 (EVAL_17:62)»
Resolved in git 33e3839 and unfudged tests.
Thanks,
On Mon Apr 13 01:23:13 2009, masak wrote:
masak rakudo: class A::C {}; A::B.foo
p6eval rakudo 679e48: OUTPUT«Null PMC access in invoke() [...]
* masak submits rakudobug
Resolved in git 33e3839 and unfudged tests.
Thanks,
Jonathan
On Tue Jun 23 03:08:44 2009, masak wrote:
masak rakudo: enum A b; say A::c
p6eval rakudo 10f223: OUTPUT«Null PMC access in invoke() [...]
* masak submits rakudobug
Resolved in git 33e3839 and unfudged tests.
Thanks,
Jonathan
David Green david.gr...@telus.net wrote:
Maybe setting $*CWD just calls chdir() under the hood? Same implementation,
brand new shiny Perl-style interface!
I don't think that's a good idea. Suppose you have code like this:
$*CWD = '/some/absolute/path';
$*CWD = '../relative/path';
my
This is fixed nowadays. Resolving ticket.
Moritz wrote:
However it seems we have to pay a price: each act of rendering a Pod
file actually means executing the program that's being documented (at
least the BEGIN blocks and other stuff that happens at compile time),
with all the security risks implied. So we'll need a *very* good
On Mon Jun 15 04:17:36 2009, moritz wrote:
On Mon Jun 15 04:01:34 2009, moritz wrote:
Hi,
multi to-json(Str $d) {
$d.trans([''] = ['\']).subst(/-[\c0..\c127]/, { a }, :g)
}
say to-json(möp);
Actually the .trans call is not necessary, a simple .subst also fails.
Now
Raiph commented:
Couldn't the pod processing be encapsulated, perhaps in PGE/NQP, so
that it could be reused in a different Parrot language, provided that
said language supports declarators and comments, or even just comments
(if one downgrades the impact of encountering an attached comment
Jonathan Dataweaver Lang enquired:
Will ther be any ambiguity between Pod and wraparound operators that
begin with =?
No. Lines that start with an '=' that is *immediately* followed by an
identifier are always Pod. If there's a space after the '=' it's always
an assignment. You could *create*
On Tue Apr 21 03:50:19 2009, masak wrote:
This might be in RT already, but I didn't find it, so...
ihrd rakudo: multi foo (@a) { 1 }; multi foo ($a, %h?) { 2 }; say
foo(1 2 3);
p6eval rakudo 69b318: OUTPUT«Ambiguous dispatch to multi 'foo'.
Ambiguous candidates had
Could we also get =numbered and =term directives that are
equivalent to =item :numbered and =item :term, respectively, for
use with abbreviated blocks? E.g.:
=numbered First Item
=numbered Second Item
=numbered Third Item
That's just:
=item # First Item
=item # Second
On Mon Aug 03 11:50:06 2009, colo...@gmail.com wrote:
colomon: rakudo: multi a () { 1 }; multi a (*...@x) { 2 }; say a();
[2:33pm] p6eval: rakudo 18598d: OUTPUT«Ambiguous dispatch to multi
'a'. Ambiguous candidates had signatures::():(Object *...@x)in Main
(/tmp/8uPi9JrI7p:2)»
This
On Wed, Aug 19, 2009 at 11:54 AM, Damian Conwaydam...@conway.org wrote:
Moritz wrote:
However it seems we have to pay a price: each act of rendering a Pod
file actually means executing the program that's being documented (at
least the BEGIN blocks and other stuff that happens at compile
On Wed, Aug 19, 2009 at 11:03, Kyle Hasselbacherkyl...@gmail.com wrote:
Perl 5 programmers are sometimes surprised to find that 'perl -c
strange.pl' can execute code. Imagine their surprise to find that
'perl6doc' does too.
this is why it's spelled 'perl6 --doc', which should give you some
Kyle suggested:
Pod itself is a DSL.
Sure. But to allow arbitrary processing and rendering of Pod, a DSL
isn't enough.
If we're committed to giving guns to books, can we default to having
the safety on? Can it be so that 'perl6doc foo.pl' does not execute
any code without an option to allow
Damian Conway wrote:
When using the code block alias, are the outermost curly braces
considered to be part of the ambient code?
Yes. All ambient code is actual code.
OK. Let me propose an alternative (which I expect will be immediately
shot down):
Allow '=begin alias', '=end alias', and
Jonathan Dataweaver Lang proposed:
OK. Let me propose an alternative (which I expect will be immediately
shot down):
BANG!
;-)
Allow '=begin alias', '=end alias', and '=for alias' as special cases:
the Perl parser makes an exception for them and doesn't treat them as
the start or end of
On 2009-Aug-19, at 5:00 am, Troels Liebe Bentsen wrote:
My idea of working with file names would be that we default to
locale or
filesystem settings, but give the options of working with paths/file
names as
binary or a specific encoding.
As mentioned in the old thread, encoding is only
FWIW, the current proposal for aliasing blocks of ambient text is
functional; it just feels a bit kludgey, and I'm a bit bothered by the
fact that you can't alias any ambient text other than a code block.
On Wed, Aug 19, 2009 at 11:29 AM, Damian Conwaydam...@conway.org wrote:
Jonathan Dataweaver
Timothy, thanks for your feedback.
My proposal was never about the syntax, which I stated at the end, but rather my
syntax was just illustrative. I actually meant for p{} or whatever syntax to be
used, but I didn't recall those details and was keeping it simple. And the use
of a %DOI hash
On 2009-Aug-19, at 8:07 am, Jon Lang wrote:
On Wed, Aug 19, 2009 at 5:37 AM, Jan Ingvoldstadfrett...@gmail.com
wrote:
On Wed, Aug 19, 2009 at 1:54 PM, Moritz Lenz via RT perl6-bugs-follo...@perl.org
wrote:
It doesn't mention how the postcifcumfix:[ ] is supposed to
introspect
those to find
Richard Hainsworth wrote:
I think this is a much more flexible system than those suggested so far.
It seems to me that this approach
- lets the OS and the implementation deal with pathways that are valid
(taking into account locale and OS constraints).
- defines only that part of the
Mark J. Reed wrote:
On Wed, Aug 19, 2009 at 2:35 AM, Darren Duncan dar...@darrenduncan.netwrote:
(If Perl really must have the ability to change the non-virtual current
working directory, such as because its going to spawn another non-Perl
process, then this should use some separate mechanism
David Green wrote:
Jon Lang wrote:
Given that it's relatively easy to say 1..^*, I wouldn't mind
standardizing this so that '*' always refers to the element just past
the last one, at least when dealing with the standard index.
I like the DWIMmery, but the more I think about it, for such a
Darren Duncan wrote:
The named filesystem roots can be defined or altered at runtime by Perl
code, and each one is defined within the context of another.
I should clarify my intention here, which is that each DOI is mapped behind the
scenes by Perl to a standalone absolute filesystem url, and
'home' should be spelled '~'.
--
Jonathan Dataweaver Lang
Jon Lang wrote:
'home' should be spelled '~'.
Yes, of course. And conceptually a DOI can be any string at all. Logically
we'd probably have non-alpha names for many of the common/standard ones. --
Darren Duncan
On 2009-Aug-19, at 2:08 am, Darren Duncan wrote:
%DOI{'mycwd'} = %DOI{'fscwd'};
%DOI{'mycwd'} ~= 'subdir';
# later
my $fh = IO.open( 'mycwd/myfile.txt' );
For ease of use, we can still have vars like $*CWD, which might be
an alias for a doi with a specific name.
I've been thinking of
Author: wayland
Date: 2009-08-20 00:04:27 +0200 (Thu, 20 Aug 2009)
New Revision: 28036
Modified:
docs/Perl6/Spec/S16-io.pod
docs/Perl6/Spec/S32-setting-library/IO.pod
Log:
[S16] Documented $*CWD which was mentioned once in S28
[S32] Changed Path to have Buf instead of Str, and an
This is an automatically generated mail to inform you that tests are now
available in t/spec/S05-capture/named.t
commit 366cffad4aea063bae83f8419a7dc2f115e81fa3
Author: moritz mor...@c213334d-75ef-0310-aa23-eaa082d1ae64
Date: Wed Aug 19 22:14:35 2009 +
Test for RT #68680, Match.orig
On 2009-Aug-18, at 7:20 am, Timothy S. Nelson wrote:
On Tue, 18 Aug 2009, David Green wrote:
Some ways in which different paths can be considered equivalent:
Spelling: ... Simplification: ... Resolution: ... Content-wise: ...
Ok, my next commit will have canonpath (stolen directly from p5's
Should there not be a way to define object constructors with custom
signatures that can be usefully invoked like a normal constructor?
Currently, defining a BUILD method for a class with a specific signature
doesn't seem to allow for the object to be invoked by new with that
signature and
I don't think $file1.name == $file2.name should talk to the FS,
because I think File#name t+r whatever) should return a plain Str.
Having magical FilePathName objects is handy, but sometimes you want
to get the filename as a dumb string to do stringish things without
having to worry about the
I'm confused. The signature of initialize is used by Class.new in
Ruby; the signature of __init__ is used by class_name() in Python...
How is doing the same thing too much magic? Or am I misunderstanding
the suggestion?
On 8/19/09, Kevan Benson kben...@a-1networks.com wrote:
Should there not
This is an automatically generated mail to inform you that tests are now
available in t/spec/S06-advanced_subroutine_features/lexical-subs.t
commit fe7743375a601c19eb3cf969eb9e391544b7a32d
Author: moritz mor...@c213334d-75ef-0310-aa23-eaa082d1ae64
Date: Wed Aug 19 22:57:24 2009 +
I think the too much magic is in automatically creating the
appropriate new method with that signature. I idea is to get the
standard behavior, which is to define a method that's signature is used
for the instantiation.
Currently, I believe you have to define at least new and BUILD, not
Em Qua, 2009-08-19 às 15:37 -0700, Kevan Benson escreveu:
Should there not be a way to define object constructors with custom
signatures that can be usefully invoked like a normal constructor?
What's the problem with
method new(Str $timestamp) {
self.SUPER::new(ts =
On 2009-Aug-19, at 4:37 pm, Kevan Benson wrote:
I'm aware there's a default constructor that allows named parameters
to be set, but I think the usefulness of allowing specific
constructors that take defined parameters and initialize the object
as needed should not be overlooked. E.g.
On Wed, 19 Aug 2009, Mark J. Reed wrote:
I don't think $file1.name == $file2.name should talk to the FS,
because I think File#name t+r whatever) should return a plain Str.
Having magical FilePathName objects is handy, but sometimes you want
to get the filename as a dumb string to do stringish
I should've mentioned, though, we're currently using the smartmatch
operator for this, so I'm thinking maybe I'll just stick with that.
:)
-
| Name: Tim Nelson | Because the Creator is,|
|
On 2009-Aug-19, at 4:38 pm, Mark J. Reed wrote:
I don't think $file1.name == $file2.name should talk to the FS,
because I think File#name t+r whatever) should return a plain Str.
I was thinking === rather than eq might be enough distinction, but
you're right, confusion is too likely.
Maybe
Good comments, David.
David Green wrote:
snip
So the set of default standard dirs would just be a hash of IO objects:
$IO::DOI{home}, $IO::DOI{docs}, etc. Actually, different OS's would
provide different sets of standard named dirs, and you should be able to
import them:
# Assume I'm
On behalf of the Rakudo development team, I'm pleased to announce
the August 2009 development release of Rakudo Perl #20 PDX.
Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1].
The tarball for the August 2009 release is available from
http://github.com/rakudo/rakudo/downloads
Author: wayland
Date: 2009-08-20 07:12:22 +0200 (Thu, 20 Aug 2009)
New Revision: 28040
Modified:
docs/Perl6/Spec/S16-io.pod
docs/Perl6/Spec/S32-setting-library/IO.pod
Log:
[S32/IO] and [S16] Changes include:
* Removed spurious references to Array of, now that pmichaud++ has explained
68 matches
Mail list logo