»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
discord6 <Tyler (Aearnus)> wrote a cute little one liner for opening the SCP wiki: #!/usr/bin/env perl6 sub MAIN($scp-number) { shell "xdg-open 'www.scp-wiki.net/scp-$scp-number'"; } 01:53
Xliff say (1, 2, 3, 4) «+» 1 xx 4 01:57
evalable6 ((2 3 4 5) (2 3 4 5) (2 3 4 5) (2 3 4 5))
Xliff say (1, 2, 3, 4) «+» 4
evalable6 (5 6 7 8)
Xliff m: my @x = (1, 2, 3, 4); @x «+» 2; @x.say 01:58
camelia Potential difficulties:
Useless use of «+» in sink context
at <tmp>:1
------> 3my @x = (1, 2, 3, 4); @x 7⏏5«+» 2; @x.say
[1 2 3 4]
Xliff m: my @x = (1, 2, 3, 4); @x «+=» 2; @x.say
camelia [3 4 5 6]
holyghost If someone can take a look at github.com/theholyghost2/Mathx-Stat and Bayes-Learn, I can rerelease them (using issues) 05:53
jmerelo holyghost: did you delete the releases from CPAN?
holyghost no 05:54
jmerelo holyghost: That's the first thing you should do.
holyghost It compiles and has ocvs howwever
jmerelo holyghost: That's not the minimum requirement for releasing something on CPAN. 05:55
holyghost also includes tests
jmerelo holyghost: please run them and come back to us.
holyghost they run
jmerelo holyghost: meanwhile, and as stated yesterday, please delete them from CPAN and don't release them again until at least two of us have reviewed them. 05:56
holyghost: yesterday you agreed to a series of things, including the fact that something released to CPAN must go beyond a certain level of quality. 05:57
holyghost: you seem to have forgot everything we said.
holyghost: by "run them" I mean "run the tests"
holyghost: really, I'm not going to go every single day over the same old issues.
those repos are exactly the same they were yesterday and in Novembre 2018 05:58
holyghost the tests work I mean
I have run them all, they succeed
jmerelo holyghost: can you walk me through the commands you issued for running them? 05:59
holyghost a perl6 with a flag, they all succeeded 06:00
jmerelo holyghost: those repos you've pointed to have not changed for the last 8 months. They didn't get any better by themselves. The issue is still not addressed. The markdown in README.md is badly formatted. 06:01
holyghost I updated them yesterday
jmerelo holyghost: in CPAN? 06:02
holyghost: the Mathx-Stat repo says "Latest commit 04c683a on 23 Nov 2018"
holyghost: I don't know if you are lying, or simply you don't know better.
holyghost I used my browser, I'll try later on with a git shell command 06:03
jmerelo holyghost: your GitHub activity panel is empty since December last year.
holyghost I see
jmerelo holyghost: It says "no activity in the period January-May 2019" 06:03
holyghost: I am starting to lose my patience here. 06:04
holyghost: please get your act together.
holyghost I need to use a git shell, I said, my browser does not work for it
jmerelo holyghost: No, you need to delete all your modules from CPAN right now. 06:05
holyghost: you simply seem unable to use, or understand, the basic tools involved in creating, testing and publishing a module.
holyghost I'll remove the modules later on
jmerelo holyghost: Please do it now. 06:06
holyghost I will
jmerelo holyghost: we'll help you solve all your doubts about publishing modules, git, testing and perl itself when you do that. If you do that, and only if you do that.
Geth doc: 6c0e8cb506 | (JJ Merelo)++ | doc/Type/List.pod6
Improves explanation of reduce and checks examples

As a matter of fact, #1399 is no longer relevant or has been solved. So it closes #1399
06:19
synopsebot Link: doc.perl6.org/type/List
holyghost jmerelo : All my moules are scheduledd for deletion on cpan (by Sat 01 June) 06:23
Now, I can restart without losing time on cpan 06:24
I need to find a git shell client though, as my browser does not upload correctly 06:25
I hope my Karma will better now
jmerelo thanks, holyghost 06:31
you need to learn how to use git properly
holyghost np :-)
jmerelo for starters, it's not called "git shell client". it's simply called git.
holyghost yes, I have it on Xliff's server 06:32
I mean git bash etc for windows
which is horrible of course :-) 06:33
jmerelo holyghost: git does not need bash. You can download a GitHub client that includes a bash shell with git in it. But git can be installed in Windows and used directly. You can also use it from the Ubuntu subsystem (in W10)
holyghost I'll repair the github uploads later on 06:35
holyghost I'll let you know when it works 06:35
rba Hi Liz, are you around? 06:42
holyghost Mathx::Stat is ready for review, it's on github.com/theholyghost2/Mathx-Stat 06:55
I updated it in browserless git 06:56
(using git on the command line)
noisegul Good morning #Perl6 07:01
holyghost good morning
holyghost Bayes-Learn is also ready for review, github.com/theholyghost2/Bayes-Learn 07:17
I'll leave it there to accomodate these 2 packages
jmerelo holyghost: it's not ready, and it will not be until Mathx::Stat is ready and released. 07:33
jmerelo holyghost: all guidelines for publishing a module are public. You should create a checklist yourself and follow it strictly. 07:33
holyghost: we can't help you with a blanket "review". We can help you if you have specific doubts about the procedure. 07:34
holyghost jmerelo, I won't upload anything
ah
So I have to specify, ok
jmerelo holyghost: just a cursory look at the code shows that it will not compile in some cases. That's why you need to go through all the things that have laid out in the issues in Bayes, which I will not repeat in other modules. 07:35
holyghost ok 07:35
jmerelo, thanks 07:37
I'll fix the issues and start with Mathx::Stat as you sai 07:38
*sai
*said
jmerelo holyghost: thanks.
Woodi hi #perl6 :) 08:36
jmerelo Hi Woodi !
Woodi holyghost: assuming you have function twoPlusTwo() how you check it work like expected ? ;) 08:37
holyghost 2++ :-) 08:39
lizmat m: sub infix:<+>(\a,\b) { 42 }; use Test; is 1+1,1+1 # success! 08:43
camelia ok 1 -
lizmat m: sub infix:<+>(\a,\b) { 42 }; use Test; is 1+1,2 # huh?
camelia not ok 1 -
# Failed test at <tmp> line 1
# expected: '2'
# got: '42'
masak lizmat: is the "huh?" comment because you didn't expect your override to work and give the value 42? because it looks unsurprising to me... 09:16
lizmat this was about holyghost's way of testing 09:17
lizmat holyghost is always testing 1+1 versus 1+1 09:17
which passes, but 1+1 is still giving the wrong result
so the huh? was about "but I thought I tested it correctly before?" 09:18
masak oh, I see! 09:19
yes, hidden assumptions are hidden
in general, `is X, X` for any X is pretty unnecessary... unless we're testing equality itself 09:20
timotimo masak: unless X is something that you would like to verify doesn't modify state that changes its outcome for the next time 09:21
m: use Test; is $++, $++ 09:22
camelia ok 1 -
timotimo er
masak :)
timotimo m: use Test; my $a; is $a++, $a++
camelia not ok 1 -
# Failed test at <tmp> line 1
# expected: '1'
# got: '0'
masak I'm not sure I'd consider that exceptional case to be very strong
timotimo yeah, it's not very strong, and it's surely not the only kind of test you should have, not by a long shot 09:23
masak mostly because I was on the verge of saying something about `is <actual value>, <expected value>`, and your case doesn't follow that pattern
timotimo there's also one test of the form "ok <actual value>, <expected value>;"
which is wrong for different reasons
masak :( 09:24
jmerelo timotimo: in general, this kind of tests do not make a lot of sense unless you want to handle side effects. 10:03
timotimo: they are of course possible, but first and foremost, you should check the method or routine return value, type, and so on. Also, edge cases. 10:04
timotimo: I've seen my share of student tests which are done just for the sake of passing the assignment. 10:05
timotimo ha 10:09
jmerelo timotimo: no, really. In many cases TDD means for them "eliminate all functions I can't think of a test for or that does not pass tests" 10:24
timotimo "subtractive tdd" :) 10:25
jmerelo timotimo: :-) 10:26
HarmtH lizmat: Could you please have a look at this issue again: github.com/rakudo/rakudo/issues/2929 10:37
lizmat HarmtH: yeah, it's on my rader 10:37
for later today :-) 10:38
HarmtH lizmat: Ok nice, didn't know for sure if you got a notification, as it's a closed issue
s/it's/it was/
lizmat yup, reopened it 10:39
holyghost Soundn-Tina also has been updated on github 10:55
masak jmerelo, timotimo: there's a mocking subtrope of subtractice testing, which I see quite a bit -- (a) write a mock, (b) test that it works, (c) forget to test the System Under Test that the mock should have been connected to 11:02
masak subtractive* 11:02
holyghost feeping creaturisms 11:06
masak more like a general misunderstanding of mocks, and their TDD
timotimo ha, i haven't heard of that one yet 11:11
pmurias jmerelo: re truffle and js backends they are independent projects (they share the backend independent part as the experience from the working on the js backend helps a ton with the truffle one) 11:24
yoleaux 23 May 2019 23:38Z <MasterDuke> pmurias: wasn't bigint support a blocker for rakudo.js in firefox? if so, looks like it will be good soon wingolog.org/archives/2019/05/23/b...in-firefox
pmurias .tell MasterDuke great, I moved to a pure js replacement for firefox but it's good that proper bigint support arrived there too 11:25
yoleaux pmurias: I'll pass your message to MasterDuke.
nwellnhof p6: say sort {1}, ^$_ for ^6 11:26
camelia ()
(0)
(1 0)
(0 1 2)
(0 1 2 3)
(0 1 2 3 4)
nwellnhof p6: say sort {1}, ^2
camelia (1 0)
nwellnhof Note that sort isn't stable with two elements. 11:27
lizmat hmmm...
please make an issue...
sort has a separate code path for 2 elements
Xliff \o 11:29
holyghost 'lo Xliff 11:40
jmerelo pmurias: OK, I imagined that, but I didn't know for sure... 11:43
pmurias: thanks
masak: that's rich :-) 11:44
tobs How do I add a multi candidate via .^add_method? Specifically I want to add a particular ACCEPTS method to an enum. 11:45
timotimo tobs: i think there's actually an .^add_multi_method perhaps 11:45
tobs timotimo: you're right, there's a role Metamodel::MultiMethodContainer but it's not documented it seems 11:47
jmerelo tobs: I heard documented
timotimo haha
tobs flies to the doc issues 11:48
jmerelo tobs: but yep, you're right. Since Metamodel::* are implementation dependent, we're doing that... slowly. A bit slowlier than the rest, anyhow. 11:49
tobs: grateful if you raise the issue. 11:50
tobs D#2829 12:05
synopsebot D#2829 [open]: github.com/perl6/doc/issues/2829 Metamodel:: roles missing
tobs timotimo: it worked \o/ gist.github.com/taboege/53fc512a05...00eea119f7 12:13
timotimo cool 12:17
holyghost I managed to make a XCode, Objective-C prototype of a game for perl6, Xliff I'll upload to objc on the ama server 12:29
holyghost 1000 lines of quest for glory thingies 12:30
I know it's copyrighted, don't worry 12:31
SmokeMachine I would love if someone write a iOS perl6 app like pythonista (but for perl6)
omz-software.com/pythonista/ 12:32
does anyone know how possible it is?
holyghost that's easier than it looks, but however I don't know how to make a perl6 iOS app 12:34
You can use the SDL2 module for the widgettree or Gtk for a prefab widget system 12:35
so you need a gfx module to make an editor
I worked on Aldhebrand perl IDE for macos in objc
It was never fnished though :-)
It's on Xliff's ama server, in the objc dir 12:37
holyghost's home dir then objc dir
Then AFAIK you need pango for syntax highlighting 12:38
or again XCode, cocoa features
pango is an old gnome system for fonts AFAIK 12:39
sdo hello 12:39
holyghost hi
sdo Is there anyequivalences for Perl 6 to use CGI? 12:40
I found Astaire but can't intall it from zef
hi holyghost
holyghost sdo, maybe it's on github 12:41
sdo ok
holyghost I wouldn't know if there's perl5's use CGI etc in perl6, I'm no web dev
timotimo sdo: yeah, astaire is suuuuuper old 12:42
2010 was the last meaningful commit
there are FastCGI modules for perl6, and there's an SCGI module 12:43
also ,there's an adapter between FastCGI and PSGI
sdo I found SCGI but couldn't figure out how it worked :-( 12:44
timotimo to be honest, perl6's startup can be a problem for something like web apps
timotimo pretty much every web framework we have should support just listening on a local port, so that you can use mod_proxy or similar in your actual web server to make it reachable 12:45
masak what about Cro?
timotimo that way the web server can handle SSL and HTTP2 and all that, while your app can just receive requests and deliver responses via simple HTTP
sdo Ok I check thanks for the advices 12:50
timotimo cro is very good
powerful if you need it, but simple enough if you don't
masak I guess my question is really "should we recommend Cro by default to people who come and ask #perl6 about web frameworks?" 12:53
also, I'm a bit freaked out that people even find the Web.pm project, let alone Astaire -- maybe I should put up a big warning about staleness and bitrot? 12:55
timotimo perhaps :) 12:57
if you only edit the github project description, you can change things without the date moving up
holyghost .tell Xliff, there's an objc dir now on the ama server, you can take a look for MacosX apps (XCode from apple, objective-C as a language), a game system and Sound Studio WIP 13:00
yoleaux holyghost: What kind of a name is "Xliff,"?!
sdo ok I found something Called Cro. It is documented and made some tests hello.p6 after following carefully the instructions on the website. Thanks a lot for your precious help 13:01
timotimo \o/ 13:03
holyghost .tell Xliff the game system (PaganHeroesQuest-Mac) is what will be worked on by you and me for a perl6 live game
yoleaux holyghost: I'll pass your message to Xliff.
holyghost .tell Xliff without copyright issues of course
yoleaux holyghost: I'll pass your message to Xliff.
Xliff . 13:04
yoleaux 13:03Z <holyghost> Xliff: the game system (PaganHeroesQuest-Mac) is what will be worked on by you and me for a perl6 live game
13:03Z <holyghost> Xliff: without copyright issues of course
Xliff holyghost: Still busy on my own projects. I will try to take a look over the weekend. 13:05
holyghost np, I just wantedd to serve you, it's a very simple project 13:06
holyghost If you see my game system based on Entity and Room, you'll join gladly to extend for graphics software 13:06
*graphics, game
Xliff holyghost: Weekend. See you then. 13:07
holyghost ok
holyghost It's nethack licensed, I hope to release "our" game under that license with the default perl licenses 13:08
It's a nice license for games :-)
haha, only serious, I might add a ncurses system except for the collision detection *lol* 13:10
Xliff FIRST! Before any games. I want to get you to learn how to set up build and dependency scripts so that your releases improve!!!
holyghost I'd like to make a nethack/roguelike with gfx 13:11
holyghost ok Xliff 13:11
dependency scripts flabberghast me though :-) 13:12
holyghost I have no idea I mean 13:12
anyway, I'm slowly but painfully going to quit coding, I'm a bit afk I mean 13:15
ugexe stackoverflow.com/a/55940571 is a good sanity test 13:16
holyghost Xliff, there's a page for nethack game development (and roguelikes for that) on nethack.org/docs/nh362/ it includes dungeon compiler syntax and so on, I need to read that first before next week, then do my thing on Mathx::Stat and Bayes::Learn (JJ's issues on github) 13:32
So we have enormously time left before you have to do anything :-) 13:33
holyghost Xliff, you are of course free to mail me with game ideas, but, the graphical interface I've done many times, so we need to debug that first then write *any* type of game with it, then personally I'd like to setup *a* RPG system 13:56
Xliff, I guess game modules have to be made for it as stated above, but nothing too difficult, e.g. no Baum-Welch algorithm or an ANN and so on 13:59
The drawing of images should be the first thing I work then make adapter code, AFAIK, for any game entities 14:00
*work out
I mean the design pattern for an adaptor 14:01
Basically, you just make several Entity subclasses paint them from a list in a loop, update them each loop and you have a game server 14:03
Room subclasses update likewise
you just scroll of a stupid backgroundd image and you're done
holyghost Then adapters just get dispatched to game subsystem such as e.g. a physics engine 14:04
*game subsystems
Then AI messages, as the word says, are very noisy code which dispatch a AI message to the DM, NPCs, PC and so on 14:05
NPC=nonplayerchar, PC=player char DM=dungeon master 14:06
That's the most easy thing you can do to make a game
AI,gfx and gameplay, then opengameart.org for example 14:08
Xliff, also I do make my own graphics sometimes, I'm not terrific but I can manage 14:09
I mostly use The Gimp
anyway, I might repeat myself here but I'm going to shut up for now 14:10
holyghost anyway Xliff, Take your time (to check out the code) 14:28
I'm going to code up and fix a bootstrap in git now for the game 14:36
holyghost .tell Xliff I bootstrapped the main game system, it's in github.com/theholyghost2/PaganVisions2 it's also on the ama server, do take a look if you find the time, the graphics routines such as SDL_LoadBMP etc are commented out, they should be debgugged 15:02
yoleaux holyghost: I'll pass your message to Xliff.
holyghost ok, beertime, enjoy the game code :-) 15:06
manemobiili i'm not a programmer yet, but now i got perl6 on gemini pda running sailfish os 15:07
it's glorious
holyghost .tell I put everything in TODO.txt, please do not overwrite it if I may say so 15:23
yoleaux holyghost: I'll pass your message to I.
holyghost .tell Xliff I'll want to manage a debugging session next week, if you have the time, take your time and good night (probably) ! 15:28
yoleaux holyghost: I'll pass your message to Xliff.
Xliff . 15:31
yoleaux 15:02Z <holyghost> Xliff: I bootstrapped the main game system, it's in github.com/theholyghost2/PaganVisions2 it's also on the ama server, do take a look if you find the time, the graphics routines such as SDL_LoadBMP etc are commented out, they should be debgugged
15:28Z <holyghost> Xliff: I'll want to manage a debugging session next week, if you have the time, take your time and good night (probably) !
Xliff takes a nap.
holyghost It's all in TODO.txt in the lib/PaganVisions2 dir 15:35
Xliff ^^
I am going to elevate myself with a levitate spell from my sofa now :-)
Enjoy! I'm again a bit afk 15:36
holyghost jmerelo : the start of the XLiff'nHolly game at github.com/theholyghost2/PaganVisions2 15:40
Nothing in cpan, just github :-) It needs to debugged with image handles by Xliff next week, the source is there, there's also a TODO.txt, if you'd like to help out, do file PRs, issues, game ideas and so on, it should become a roguelike, with gfx 15:41
Anyway, JJ I'm happy coding games again and having no trouble uploading with your good measures :-) 15:42
lizmat weekly: donaldh.wtf/2019/05/roman-numerals-in-perl-6/ 17:01
notable6 lizmat, Noted!
jmerelo lizmat: cool! 17:05
Geth doc/master: 4 commits pushed by (JJ Merelo)++ 17:20
jmerelo squashable6: status 17:21
squashable6 jmerelo, ⚠🍕 Next SQUASHathon in 1 day and ≈10 hours (2019-06-01 UTC-14⌁UTC+20). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
jmerelo lizmat: that was not included in the p6 weekly, right?
lizmat argh... no 17:22
:-(
jmerelo lizmat: no problem. Everyone who should know is probably here or in #perl6-dev
lizmat jmerelo: please leave a note with "weekly: sqaushathon!" next time :-)
jmerelo lizmat: I'll do that. Sorry... 17:26
lizmat no, I should have realized it was the last week of the month, aka next weekend is the next month
so I should have pinged you for more info 17:27
jmerelo Anyway. I'll post something in Twitter just in case. This is a Rakudo/NQP/MoarVM/roast squashathon, and there's not been one for some time.
Let's see if we can address a few issues or PRs. I'll try and focus on pinging the PRs and closing those that are stale... 17:28
woolfy jmerelo: I just posted about the Squashathon in the Perl6 group on Facebook. www.facebook.com/groups/perl6/perm...281869184/ 17:45
jmerelo woolfy: thanks! 17:47
Xliff m: ((^255).rand.floor xx 3).say 17:48
camelia (227 108 43)
moritz m: say (^255).pick(3) 18:01
camelia (98 198 83)
Xliff m: say "ClutterLongPressState" ~~ / (<[A..Za..z]>)+ %% [ <[a..z]>+ ] /; 18:13
camelia 「ClutterLongPressState」
0 => 「C」
0 => 「L」
0 => 「P」
0 => 「S」
0 => 「e」
cpan-p6 New module released to CPAN! Log::Timeline (0.2) by 03JNTHN 18:14
ufobat__ $roman.comb().reverse.map({%roman2num{$_}}).reduce({state $l = $^s; $l = $^b; $s + (($l > $b)*2-1) * $b}); 19:47
antoniogamiz o/ 19:50
Xliff ufobat: Ooh! Nice code! :) 20:15
ufobat: Won't $s and $b not be declared, tho? 20:16
leont The $^s and $^b take care of that 20:17
andrzejku Hey, I want to ask 20:18
about Perl6 and GNU
andrzejku how is relations going? 20:18
skids
.oO(maybe (-$b,$b)[$l > $b] would be clearer)
20:26
lizmat weekly: www.youtube.com/watch?v=nyULDBBqe8...8&t=0s
notable6 lizmat, Noted!
lizmat weekly: www.youtube.com/watch?v=GdU5XUck8O...3&t=0s 20:27
notable6 lizmat, Noted!
lizmat weekly: www.youtube.com/watch?v=-YcoL_MLn6...4&t=0s
notable6 lizmat, Noted!
lizmat weekly: www.youtube.com/watch?v=e3BjE3jCZl...0&t=0s 20:28
notable6 lizmat, Noted!
lizmat weekly: www.youtube.com/watch?v=z0diaaOc1u...5&t=0s
notable6 lizmat, Noted!
lizmat weekly: www.youtube.com/playlist?list=PLw3...QWSs64toD4 # the whole list 20:29
notable6 lizmat, Noted!
lizmat weekly: perl6.eu/crypto5.html 20:43
notable6 lizmat, Noted!
Xliff m: class A { method get_static($a) { $a.ord }; }; my enum Alpha ( 1 => A.get_static(a'), 2 => A.get_static('b'), 3 => A.get_static('c') ); Alpha.enums.say 20:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3; }; my enum Alpha ( 1 => A.get_static(a7⏏5'), 2 => A.get_static('…
Xliff m: class A { method get_static($a) { $a.ord }; }; my enum Alpha ( 1 => A.get_static('a'), 2 => A.get_static('b'), 3 => A.get_static('c') ); Alpha.enums.say
camelia Map.new((1 => 97, 2 => 98, 3 => 99))
Xliff m: class A { has $!a; submethod BUILD (:$!a) {}; method get_static($a) { self.bless( a => A.new($a.ord) }; }; my enum Alpha ( 1 => A.get_static('a'), 2 => A.get_static('b'), 3 => A.get_static('c') ); Alpha.enums.say 20:47
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3ic($a) { self.bless( a => A.new($a.ord) 7⏏5}; }; my enum Alpha ( 1…
Xliff m: class A { has $!a; submethod BUILD (:$!a) {}; method get_static($a) { self.bless( a => A.new($a.ord) ) }; }; my enum Alpha ( 1 => A.get_static('a'), 2 => A.get_static('b'), 3 => A.get_static('c') ); Alpha.enums.say
camelia ===SORRY!===
Default constructor for 'A' only takes named arguments
Xliff m: class A { has $!a; submethod BUILD (:$!a) {}; method get_static($a) { A.new(a => $a.ord) ) }; }; my enum Alpha ( 1 => A.get_static('a'), 2 => A.get_static('b'), 3 => A.get_static('c') ); Alpha.enums.say 20:48
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3hod get_static($a) { A.new(a => $a.ord) 7⏏5) }; }; my enum Alpha ( 1 => A.get_stati
expecting any of:
statement end
statement modifi…
Xliff m: class A { has $!a; submethod BUILD (:$!a) {}; method get_static($a) { A.new(a => $a.ord) }; }; my enum Alpha ( 1 => A.get_static('a'), 2 => A.get_static('b'), 3 => A.get_static('c') ); Alpha.enums.say 20:49
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot auto-generate a proto method for 'Int' in the setting
at <tmp>:1
Xliff ^^ Any ideas what this means or how to fix?
antoniogamiz moritz: hi! 20:58
moritz: why do you add every new definition/reference to $*DR? 20:59
if you use them later reading them from %routines-by-type
Xliff Is there a way to create an enum of objects, or constants of objects?
Xliff When I try enum, I get: Cannot auto-generate a proto method for 'Int' in the setting 21:01
When I try constants, I get: Missing serialize REPR function for REPR CStruct (Clutter::Raw::Types::ClutterColor)
ClutterColor is the CStruct I use as a base for the object Clutter::Color. Code is here: github.com/Xliff/p6-Clutter/blob/m...s.pm6#L552 21:04
timotimo that means an instance of that struct is ending up in the serialized blob
i.e. an instance was alive at the point where precomp finished 21:05
i don't see a reason why cstruct shouldn't have support for that, though
Xliff What's the best way to store objects (ie CStructs) as global types?
Right. Otherwise, it would be impossible to have global types for a CStruct... unless they were already in C. 21:06
timotimo hum?
Voldenet m: enum Meh (1 => sub{}) 21:09
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot auto-generate a proto method for 'Int' in the setting
at <tmp>:1
timotimo Xliff: i don't think i understand what you meant by that 21:12
lizmat m: enum Meh (1 => 42); say 1 # Voldenet: what do you expect to see there ?
camelia 1
Voldenet Nothing much, just trying to see if that was the error above (example with "my enum Alpha ( 1 => A.get_static('a'), 2 => A…") 21:13
Xliff m: class A { has $!a; submethod BUILD (:$!a) {}; method get_static($a) { A.new(a => $a.ord) }; }; my enum Alpha ( 1 => A.get_static('a'), 2 => A.get_static('b'), 3 => A.get_static('c') ); Alpha.enums.say 21:17
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot auto-generate a proto method for 'Int' in the setting
at <tmp>:1
Xliff timotimo: I want to map NAME to OBJECT. I'd like to do it using ENUMS
Xliff Can constants be defined in INIT? 21:17
timotimo nah, "constant" is compile-time-constant 21:18
Xliff :(
So I can't use enums, and can't use constant.
So it looks like hash-defined-in-init.
timotimo if you know the keys up front, you can at least have a bunch of variables that get assigned to during init time 21:19
if you don't know the keys yet at compile time, how do you expect to use the enums :) 21:20
Xliff I know the keys. 21:20
timotimo OK 21:21
Xliff Trying INIT block, now.
*SNARL* 21:22
Getting serialize REPR using INIT block, as well. 21:23
*REPR error
Xliff Hmmm.... 21:34
Using our $OBJECT in INIT worked. Now I have an even weirder issue.
I have an object with 4 guint values. guint := uint8 21:35
So why is it that I am getting signed values?!?
*values back from C?!?
m: say -48 +& 0xff
camelia 208
Xliff m: say 208 +& 0xff 21:36
camelia 208
antoniogamiz .tell moritz I have to go pls ask me when you can :)
yoleaux antoniogamiz: I'll pass your message to moritz.
Xliff m: say 208 +& 0x7f
camelia 80
antoniogamiz night :D
Xliff m: say (-48 +& 0xff).fmt('%x') 21:37
camelia d0
Xliff m: say (-45 +& 0xff).fmt('%x')
camelia d3