16 ms·
Learn X in Y Minutes[0] is a fresh and quick intro to Perl6. It looks jolly good, readable(!) and quite fun! I hope I get to work on a project in Perl6. [0] ht
by unixhero 11y ago
Learn X in Y Minutes[0] is a fresh and quick intro to Perl6. It looks jolly good, readable(!) and quite fun!
I hope I get to work on a project in Perl6.
[0] https://learnxinyminutes.com/docs/perl6/ https://learnxinyminutes.com/docs/perl6/
- guelo 11y agoAlso http://perl6intro.com/ http://perl6intro.com/ is a good intro.
- woah 11y agoFirst thing I read is: #`( Multiline comments use #` and a quoting construct. (), [], {}, 「」, etc, will work. ) This level of flexibility in how you make comments seems a bit... odd
- unfamiliar 11y agoI guess the intention is to let you use whatever form of parenthesis inside the comment without causing problems.
- Ulti 11y agoQuoting is highly generalised in Perl 6. Comments happen to be more feature rich and dynamic than other languages. They aren't simply ignored by the compiler but completely parsed and used in a variety of ways. The flexibility looks odd because it's meant more for quoted string interpolation, but reuses the same mechanism for comments. Generality of concepts is a common theme throughout Perl 6, if something looks round and spins it should be a wheel. For example all of the literate style POD6 comments are accessible within a variable as a fully structured tree in the $=pod variable. The 'q' quoting context in the main language allows you to use any matched quote/bracket from unicode as the markers of the start and end of a string or regex, or comments as you've picked up on. This is super helpful if you want all sorts of weird quotes and brackets inside of a string and still have it interpolated for variables for example. say q⧚This string has a "'weirdly quoted bit in'"!⧛; Will print out: This string has a "'weirdly quoted bit in'"! To see some examples of how extreme you can have these characters be from unicode check out http://xahlee.info/comp/unicode_matching_brackets.html http://xahlee.info/comp/unicode_matching_brackets.html
- pyre 11y agoAs someone that has spend significant time in Perl5, why would they use something like `$=pod`? I get that the name starts with '=' just like the pod syntax, but that doesn't mean it needs to be in the variable name. I would almost just rather that they have some sort of namespace just for 'special' variables like Python with their 'dunder' variables (i.e. double-underscore like __doc__).
- SwellJoe 11y agoI find it charming. It doesn't need to be the way that particular special variable is done, but twigils are a thing in Perl 6, and I think this is a reasonable use of them. You still have to check the docs for the dunder variables in Python. Having the same special character convention (like __var__) doesn't magically make me aware of what they all are and what they all mean. And, I've done enough Python programming to know it's a crapshoot to google for them (just as it's a crapshoot to google for sigils and twigils in Perl). You just have to know where to look for the right docs or know who to ask for where to look for the right docs (perldoc perlvar, in the case of Perl...I assume there's something similar for Perl 6, and I don't remember what it is for Python).
- cygx 11y agoThere is a special namespace like that. In fact, there are several, and they are selected by placing a second specials character after the sigil.
- lmm 11y agoI've seen parsed comments in TCL and I didn't like them there. Honestly this generalization sounds like another way to write-only code, especially the unicode brackets.
- Ultimatt 11y agoOnly if you're the kind of moron that would do it to begin with. At no point is anyone saying you should use weird quoting in comments at all. The parsed comments are used to populate dynamic documentation related to functions and classes that you can inspect at runtime. What's so bad about that?