02:50
uzl[m] joined
03:21
Guest35 left
03:30
frost joined
04:43
frost left
05:19
frost joined
08:04
dakkar joined
08:38
archenoth joined
08:42
archenoth left
09:00
archenoth joined
11:56
Nemokosch joined
12:03
Nemokosch left
14:14
frost left
14:39
Guest35 joined
16:12
kueppo joined
16:39
Manifest0 joined
16:44
dakkar left
17:16
jaguart joined
|
|||
kueppo | Hi, quick question: how useful are complex identifiers? why should we add pairs to ordinary identifiers? | 19:08 | |
Like this example from the rakudoc iirc $varname:d<e>:d<c> | 19:10 | ||
lizmat | I would say, they exist to allow identifiers such as infix:<+> | ||
and outside of the core, I've never have had a use for them yet | |||
kueppo | thank you :) | 19:11 | |
lizmat | you're welcome :-) | 19:12 | |
19:38
jaguart left
|
|||
kueppo | Just trying to understand, from Perl5's perspective, a package represents a file with bunch of related subroutines in it and we consider a package to be a module whenever it's used by another module or a program. In Raku, my confusion arise with these two constructs | 20:00 | |
Package P {} | |||
Module M {} | |||
So why does the second one exist and when should I use it if I may ask? | |||
lizmat | Well, first of all, I think you have your Perl understanding wrong | 20:04 | |
a package in Perl represents a collection of subroutines in a given namespace | |||
this *usually* coincides with a single source file, but doesn't have to be | |||
in Raku, a "package" is basically just a namespace without any bells and whistles | 20:05 | ||
or any specific meaning | |||
a "module" is just a namespace without any bells and whistles, but it is common to use that as a collection of subroutines to be exported | 20:06 | ||
a "class" is a namespace that can have methods | |||
a "grammar" is a namespace that can have rules, tokens, and regexes | |||
the "package" is really an internals thing in Raku | 20:07 | ||
any developer would usually only use class and grammar | |||
kueppo | okay, I'm trying to understand | ||
lizmat | and a developer providing a library of subroutines, would use a "module" | 20:08 | |
m: package Foo { our sub bar() { say "bar" } }; Foo::bar # Perl style | 20:10 | ||
camelia | bar | ||
lizmat | m: module Foo { sub bar() is export { say "bar" } }; import Foo; bar # Raku style | 20:11 | |
camelia | bar | ||
kueppo | why does it mean by "a package doesn't have an identity"? | 20:14 | |
*what | 20:15 | ||
lizmat | where does that say that ? | ||
kueppo | here docs.raku.org/language/packages | 20:16 | |
lizmat | I would say s/identity/bells and whistles/ :-) | 20:17 | |
and the bells and whistles are e.g. a version specification: | 20:18 | ||
m: package Foo:ver<0.0.1> { }; dd Foo.^ver | |||
camelia | No such method 'ver' for invocant of type 'Perl6::Metamodel::PackageHOW' in block <unit> at <tmp> line 1 |
||
lizmat | m: module Foo:ver<0.0.1> { }; dd Foo.^ver | ||
camelia | v0.0.1 | ||
lizmat | the identity is really the combination of version (:ver), authority (:auth) and api (:api) | 20:19 | |
kueppo | X) | ||
ah I see now | 20:20 | ||
lizmat | m: module Foo:ver<0.0.1>:auth<zef:lizmat>:api<1> { } | ||
camelia | ( no output ) | ||
lizmat | would be a full identity | ||
20:27
kueppo left
20:34
kueppo joined
|
|||
kueppo | So if I got it right, can nest grammers, modules, and classes(in any order) into a single file and require or use them anyhow since they are basically namespace? | 20:35 | |
20:40
kueppo left
21:15
kueppo joined
21:23
kueppo left
|
|||
Nemokosch | what's the idiomatic way to get the last character of a string? | 22:27 | |
in fact I might be better off matching against an ending in my particular case but the question still can be relevant | 22:29 | ||
22:31
discord-raku-bot left
22:32
discord-raku-bot joined
22:36
discord-raku-bot left,
discord-raku-bot joined
|
|||
also, the documentation of $*COLLATION is rather lacky | 22:48 | ||
collation-level? Country? Language? | |||
[13] > $*COLLATION | |||
collation-level => 85, Country => International, Language => None, primary => 1, secondary => 1, tertiary => 1, quaternary => 1 |