Nick Patch
- Website: nickpatch.net
- About: s/🚗/🚲/g
Recent Actions
-
Commented on Improved autobox-ing. I'm loving it :o)
You said that “(^10) is not as self-explanatory”. It’s not without understanding the fundamentals of Perl 6, like the operators, which are needed in order to program in the language or understand the code. Just like Perl 5 or Ruby...
-
Commented on Improved autobox-ing. I'm loving it :o)
I hadn't criticized the syntax, but I do have an example of something I'm not fond of and a reason why. I find the use of chained method calls without parens to be jarring. (0..9)->grep { $_ > 5 }...
-
Commented on Why you don't need File::Slurp…
If I recall, File::Slurp had issues with the PerlIO :encoding layer and required manual decoding of the slurped data instead, which is why I have avoided it. Not sure if this is still an issue....
-
Commented on Improved autobox-ing. I'm loving it :o)
Fortunately, TIMTOWTDI! say (0..9).grep({ $_ > 5 }).map({ $_ * 2 }).join(' - ');...
-
Commented on Improved autobox-ing. I'm loving it :o)
You'd probably like the Perl 6 solution: say (^10).grep(* > 5).map(* * 2).join(' - '); However, I'd put all of these options into the category of fun and elegant code that I wouldn't release to production....
-
Commented on Dangling Definitions
The Perl 6 version of do/if is more natural: $x = do { if ($a) { $b } else { $c } }; # Perl 5 $x = do if $a { $b } else { $c }; # Perl...
-
Commented on Perl5 Census Japan 2013
This is really interesting. I haven't used gvis before but I'll need to check it out. Thanks!...
-
Commented on Thank you Ack!
FYI, you can optionally use \P{ASCII} instead of [^[:ascii:]] and \p{Lu} instead of \p{Upper}. The ASCII one is clearly more readable and they’re both less characters to type for one-liners. Lu and Upper are both just abbreviations for Uppercase_Letter....
-
Commented on Slideshare? Really?
My biggest problem with SlideShare is that it corrupts Unicode characters in my PDF presentations that it doesn't understand, violating Unicode Conformance Requirement C7. This is a problem for Unicode 6.0 characters, possibly older versions too, and is most noticeable...
-
Commented on Pod to HTML
Jakob, Joel: Additionally, I’ve read in the colophon of multiple O’Reilly books that they were written in Pod—or an extended version of Pod—and given to the publisher in that format. I’d be surprised to see this done in Markdown without...
-
Commented on Think Python, But Perl 6 - Chapter 3: Functions
@Brian: When using fixed-width fonts, some characters may take more or less than one column to display, such as some control characters and East Asian characters. This is described in UAX #11: East Asian Width. Perl 6 doesn't have a...
-
Commented on Prototype changes across Perl release boundaries
Why not use the \@ prototype for all versions of Perl since it continues to be backward compatible? The reason the + prototype was added was to support the new functionality of each, where the value may be an array...
-
Commented on Speaking at QCon London next month
@Jerome: I can't imagine that most programmers in attendance actually pay for this. Many employers will cover the cost and send folks on company time. Compared with hiring a trainer or sending people to a multi-day training, the price isn't...
-
Commented on Pod::Perldoc at 3.19_01
This is exciting news! I use non-ASCII UTF-8 characters extensively in some of my docs, especially for modules dealing with Unicode, including grapheme clusters containing multiple code points. When I use Pod::Perldoc 3.19_01 on my laptop running Perl 5.14.2 and...
-
Commented on Understanding Unicode/UTF8 in Perl
Perl 6 syntax really helps to clarify these concepts. $str.graphs # number of graphemes $str.codes # number of code points $str.encode($encoding).bytes # number of bytes when encoded And there's also $str.chars for the number of characters in "the current (lexically...
-
Commented on Understanding Unicode/UTF8 in Perl
In those slides, the word glyph was erroneously being used for individual code points. Generally when talking about Unicode and its encodings, the three best technical terms for different levels of things that represent characters are bytes, code points, and...
-
Commented on Understanding Unicode/UTF8 in Perl
A character isn't a combination of one or more glyphs. Glyphs are used to represent characters and are provided by fonts, which are collections of glyphs. Unicode doesn't define glyphs (although it includes example glyphs in the code charts) and...
-
Commented on Why you shouldn't write short code examples in Perl
Or you could use Perl 6 for short code examples, where $a and $b are not magical.* In fact, the language generally isn't magical unless you're explicitly using magic syntax like ~~ (smartmatch) or * (whatever). And you could use...
-
Commented on A Look At Braces
It seems to me that perlfunc should be updated as such: print BLOCK LIST print FILEHANDLE LIST print FILEHANDLE print LIST print It's interesting that braces are more polymorphic in Perl than most other languages yet many of Perl's operators...
-
Commented on A Look At Braces
I always thought of #5 "File Handles Isolation" as the same as #1 "BLOCK". Just like map BLOCK LIST, we have print BLOCK LIST where BLOCK returns a filehandle. print { $o->err ? STDERR : STDOUT } $o->msg, "\n";...
-
Commented on Stop writing Perl books!*
I have a copy of an outdated book titled Writing Perl Modules for CPAN on Apress, which is quickly approaching its ten year anniversary!...
-
Commented on Announcing Math::Mathematica
Math::ematica would make us all happy :)...
-
Commented on Announcing: PerlGSL - A Collection of Perlish Interfaces to the Gnu Scientific Library
If there is a GSL namespace in the future, then we’d have various modules under: GSL:: Math::GSL:: PerlGSL:: This doesn’t seem ideal. From naming alone, I might guess that PerlGSL is either a pure-Perl implementation of GSL or one that...
-
Commented on On CPAN Namespaces: Urban Namespace Planning
Although there is a top-level Perl:: namespace, it’s used for modules related to the Perl language or code, such as Perl::Critic and Perl::Tidy. Some modules use ::Perlish to designate a Perlish syntax or semantics, but it doesn’t sound like an...
-
Commented on Milecore are, or associate with, SEO spammers
Milecore just posted a response....
-
Commented on Lodging for YAPC::NA 2012
For the Lowell Center login, enter the group code YAPC (according to the YAPC::NA 2012 lodging info)....
-
Commented on Have you seen perl-reversion?
Aristotle: You have a good point....
-
Commented on Have you seen perl-reversion?
Remember, some folks only bump the version number of modules that have actually changed, which is valid as well. I generally have a distribution version associated with the primary module, which changes for every release, and bump the version of...
-
Commented on Intro to Unicode
Here's the updated description of this talk, which is now called Fundamental Unicode. UTF-8 is the most popular character encoding on the web and has been for 5 years. Modern applications have to be developed with an understanding of Unicode....
-
Commented on Putting the ideas together, a hands on tutorial of modern Perl
Yes, words in Perl 6 is equivalent to split ' ' in Perl 5. In Perl 6, ' ' is not a special pattern for split. In general, the language is much more predictable than it's predecessor, except for certain...
Comment Threads
-
Joel Berger commented on
On CPAN Namespaces: Urban Namespace Planning
salowrey, the way this site is set up, there is almost no chance that chimerix will see your comment on this old post. Sorry.
-
mascip commented on
Improved autobox-ing. I'm loving it :o)
Thanks for your comments Nick :-)
Indeed, these bare blocks after a method call are disconcerting. I didn't even notice that. I guess that's why I compensated by putting them on distinct line: it's the only way i could make it look ok. I'm almost happy enough with the result.
I think it's not only a subjective matter. The fact that it's not seen anywhere else means that our eyes are not used to it, they don't immediately know how to interpret it. The fact that there is a given programming culture is not subjective. It is an objective fact that we have to take into account. Al…
-
Leon Timmermans commented on
Why you don't need File::Slurp…
If I recall, File::Slurp had issues with the PerlIO :encoding layer and required manual decoding of the slurped data instead, which is why I have avoided it. Not sure if this is still an issue.
Looking at the code, that's still an issue. I hadn't realized that, but that's a rather serious issue.
It also doesn't quite handle :crlf correctly either. This is a mess :-(
-
Leon Timmermans commented on
Why you don't need File::Slurp…
Functionally it's identical to
read_file(binmode => ':raw'), otherwise it's perfectly portable.Because File::Slurp can be rewritten in XS if speed is the overriding concern (and it will be faster than your 2-lines).
And it would not be faster than what I just posted. It really wouldn't. It's speed limited by the actual IO, that's the whole point.
Because File::Slurp is self-documenting.
All …
-
mascip commented on
Improved autobox-ing. I'm loving it :o)
Hey Nick. Ruby has methods who take a block as an argument. An example here with the Tree class (search for "Tree" in the page):
The result is :
a_tree.visit_all { |node| do_something_with(node) }
which will perform an operation on all nodes of the tree. I like it.
I still don't love how it looks. But i prefer writing the list name first, and then the maps and greps in the order in which they are execut…
About blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.