Perl 6 - the future is here, just unevenly distributed

IRC log for #pdl, 2014-04-21

| Channels | #pdl index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
11:03 mohawk possibly excessively 'cool'? going to make a source filter for gimp-perl scripts that adds 'my ($var1, $var2) = @_' in the script's sub - and the varnames and whatnot come from a POD section
11:04 mohawk now THAT's what i call self-documenting
12:21 vicash mohawk, what if the user does "my $var1 = shift; my $var2 = shift; <CODE>; my $var3 = shift;" ?
12:21 mohawk vicash, the vision is that this:
12:21 mohawk podregister {
12:21 mohawk my($img,$layer,$size,$color,$opacity,$xspacing,$yspacing,$xoffset,$yoffset) =@_;
12:22 mohawk can become able to leave off the my()... line
12:22 mohawk people always use the GIMP var names as their perl var names anyway
12:22 mohawk so why not cut out the middle-man
12:22 vicash makes sense
12:23 mohawk i confess i'm feeling very smug about the "using POD to obtain programme info" idea
12:23 mohawk the example scripts made by other people 'back in the day' are becoming genuinely beautiful with these changes
12:23 vicash that will depend on how well the POD has been updated
12:23 mohawk oh, i'm having to edit the POD (usually to actually add any at all)
12:23 vicash nevertheless a good idea
12:24 mohawk you are very kind
12:24 mohawk has this been done elsewhere? one of the things GIMP-perl scripts need to do is register themselves with GIMP,
12:25 vicash but how will the implicit variables handle variables that the user has declared manually
12:25 mohawk including a description of the parameters they take
12:25 vicash well automated signature generation and registration is always needed in such cases
12:25 mohawk i'm offering the option of putting the param description in a POD section called 'parameters'
12:25 vicash sounds like DCOM
12:25 mohawk which gets eval-ed
12:26 mohawk so these will be equivalent:
12:26 mohawk register ..., [ param1, param2 ];
12:26 mohawk and podregister ...; (...) =head1 PARAMETERS (blank) param1, param2
12:27 mohawk well, i'm not pretending this is some sort of introspection breakthrough or anything
12:28 vicash you should do it
12:28 mohawk basically, i'm wondering if others have thought of the idea of "pod sections have bits of code/data in them"
12:28 vicash well there is the __DATA__ section and I believe you can create similar sections. Pod::Usage uses existing pods to create usage statements
12:32 mohawk i would argue the DATA thing is different because that's not user-visible (in POD), though there's a resemblance
12:32 mohawk and Pod::Usage certainly bears a closer resemblance indeed
13:06 mohawk (i'm inferring what it does, not used or heard of it before ;)
13:07 mohawk anyway, hope you chaps are all having a great easter
18:02 [1]mohawk joined #pdl
21:45 mohawk source filter implemented

| Channels | #pdl index | Today | | Search | Google Search | Plain-Text | summary