This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
01:40 guifa joined 06:16 kjp left, kjp joined 08:47 samebchase- joined
Nemokosch is there some built-in parseable complex number syntax? 09:42
lizmat m: say i 10:08
camelia 0+1i
Nemokosch oh 10:30
'i' doesn't parse as Complex but '1i' does
from string that is
lizmat m: dd <i> 10:31
camelia "i"
lizmat m: dd <1i>
camelia ComplexStr.new(<0+1i>, "1i")
lizmat hmmm
m: dd &i'
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> dd &i⏏'
expecting any of:
infix
infix stopper
postfix
statement end
statement modifier
lizmat m: dd &i 10:32
camelia Nil
lizmat m: dd i.^name
camelia "Complex"
lizmat m: dd &term<i>
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
term used at line 1
lizmat hmmm
Nemokosch is there something odd going on? 10:40
lizmat well, I sorta assumed that a bare i would be handled by a sub term<i> somewhere, but apparently it is handled in the grammar / actions 10:56
11:12 lizmat_ joined 11:14 lizmat left, RakuIRCLogger left 11:15 lizmat_ left 11:16 lizmat joined 15:09 razetime joined, razetime_ joined 15:10 razetime_ left 15:19 razetime left 16:57 jgaz joined
jgaz I'm trying to import a rakumod I wrote into my main project code and it's not working. `use myModuleName;` isn't working. I get undeclared routine errors because the functions in that module aren't available to the rest of my code. 17:08
I'm confused. I even tried `use ./module.rakumod` etc., no joy. 17:09
Nemokosch did you install it with zef? 17:11
jgaz No, it's just Raku without zef. 17:12
It should work without zef, right? It's just a rakumod file in my source directory. 17:13
In Perl `use` "just works" without CPAN.
Nemokosch I wonder how much "Raku without zef" is a thing
jgaz It's a thing on Gentoo. I haven't gotten around to writing a zef ebuild. :-/ 17:15
Nemokosch I don't use Perl but CPAN seemed more like the repository than the module building tool
one can use zef without any repository to back it up - and since modules are precompiled, something needs to be done, other than naming a plain raku source X.rakumod
I'm not super knowledgeable with this stuff but it seems an unorthodox thing to do at the very least 17:18
Nahita jgaz: you don't need zef to `use YourModule` you have locally. To use the routines you declared in that module, however, they either need to be exported via, e.g., `is export` trait in which case you directly do `your-routine();` in the main code, and/or you make them `our` scoped in which case you do `YourModule::your-routine();` in your main code 17:19
Nemokosch okay but this goes beyond "locally", right? it's more like, if you are right in the same package
Nahita they said they get "undeclared routine" errors instead of "module not found", so i assumed that far 17:20
Nemokosch then let's say this is an "internal module" 😄 17:21
anyway, now that we are at it - what is visible to a raku file simply based on location? 17:22
jgaz Well, I was expecting the local source directory to be visible. 17:24
Nahita: Where is the documentation on the is inport trate? 17:25
Nahita even the current directory isn't looked for; need `use lib ".";` 17:26
jgaz: docs.raku.org/language/modules#Exp..._importing is a source
docs.raku.org/routine/is%20export the direct ref but above is more useful together i think 17:27
here's another one, also useful on the topic docs.raku.org/language/module-packages 17:29
jgaz Thanks all. 17:35
17:36 jgaz left
Nahita yw 17:36
18:10 MasterDuke joined 18:34 MasterDuke left 18:48 jgaz joined, Kaiepi left 18:57 Kaiepi joined 19:25 jgaz left 21:30 ab5tract joined 23:21 ab5tract left