The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2013-12-15

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 jberger joined #mojo
00:32 * jberger proposes Mojo::Collection::reduce
00:32 jamesw joined #mojo
00:33 sri jberger: rejected!
00:34 * sri has played with it... sucked pretty bad since you need two values
00:35 sri (the old $a/$b problem)
00:35 jberger what's wrong with using $a and $b?
00:37 davido joined #mojo
00:38 sri they are magical, but not magical enough
00:38 sri shit like that... https://metacpan.org/source/PEVANS/Scalar-List-Utils-1.35/lib/List/Util.pm#L30
00:40 * sri wanted reduce too... but there is no good implementation
00:48 jberger sub Mojo::Collection::reduce { local @_=($_[1], @{$_[0]}); &List::Util::reduce }
00:48 jberger yeah, not very pretty
00:49 jberger the rare use of &
00:51 jberger grrr I hate once warnings :-/
00:52 jberger has it ever caught anything useful when the rest of strict/warnings is on?? seriously
00:54 dotan joined #mojo
00:54 sri jberger: doesn't work for me
00:56 sri when added to Collection.pm
00:56 jberger http://pastie.org/8552963
00:56 jberger oh really? why should that matter?
00:57 sri prolly $a/$b hacks
00:58 sri perl -Ilib -Mojo -E 'say g("mojolicio.us")->dom->find("[id]")->attr("id")->reduce(sub { $a . $b })'
00:58 sri my test case btw
00:59 jberger I will look more later
01:00 jberger gotta step out for a bit
01:10 sri closest i ever got to linking one was with current value in $_ and result in $_[0]
01:11 sri ->reduce(sub { shift . " - $_" })
02:04 dotan joined #mojo
02:17 jberger_ joined #mojo
02:17 * jberger_ is at intermission
02:18 jberger_ sri: I suspect my version would work if you put goto before the &
02:20 jberger_ Also, iirc using @_ should work too
02:21 jberger_ Meaning $_[0] in place of $a etc
02:23 sri jberger_: "works", but it's a terrible hack
02:24 jberger_ It's using the caller's a and b
02:24 jberger_ So it's not really a hack
02:24 sri yea, which is broken
02:24 jberger_ Well yeah
02:25 jberger_ Does @_ work?
02:25 jberger_ With our wo the goto
02:25 jberger_ Or
02:27 * sri thinks it's better not to have reduce than an ugly reduce
02:27 klapperl joined #mojo
02:38 sri oh, there's precedent though, we have ->sort using @_ exclusively
02:40 dvinciguerra joined #mojo
02:43 duncanthrax joined #mojo
02:55 good_news_everyone joined #mojo
02:55 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/5oaHXw
02:55 good_news_everyone mojo/master 0cc2f52 Sebastian Riedel: added reduce method to Mojo::Collection
02:55 good_news_everyone left #mojo
02:56 sri not 100% sure about it yet, but worth playing with
03:02 good_news_everyone joined #mojo
03:02 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/yE7RxQ
03:02 good_news_everyone mojo/master 108daca Sebastian Riedel: another reduce test
03:02 good_news_everyone left #mojo
03:02 beyondcreed joined #mojo
03:05 dotan joined #mojo
03:08 russum joined #mojo
03:10 russum left #mojo
03:24 sri having a hard time thinking of real use cases now though :/
03:25 sri reduce is one of those things you think will come in handy but you never really use
03:28 mikegrb https://github.com/mikegrb/Device-RadioThermostat/pull/1 :<
03:28 mikegrb https://github.com/pjsg/Device-RadioThermostat/commit/dfc30635086a0cb8cc1a9dffd13861b5cf66bc84
03:28 mikegrb Mojo::UserAgent -> LWP::UserAgent
03:29 mikegrb and JSON
03:30 mikegrb been using Mojo::UserAgent for api client cpan modules for a while now
03:31 mikegrb so damn convienant and a way to sneap mojolicious onto more boxes :p
03:40 jberger__ joined #mojo
04:04 preflex_ joined #mojo
04:06 jberger sri: another thought: http://pastie.org/8553139
04:07 jberger actually, no need for the no warnings anymore :-)
04:07 jberger http://pastie.org/8553146
04:08 jberger that might be the most locals I've ever used :-D
04:11 good_news_everyone joined #mojo
04:11 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/-83AJQ
04:11 good_news_everyone mojo/master d644ac6 Sebastian Riedel: removed reduce method again
04:11 good_news_everyone left #mojo
04:11 sri i hate it all
04:12 jberger hahaha
04:13 sri not sure why i wanted reduce in the first place actually
04:13 jberger I want it for sum really
04:13 jberger but you can imagine more generic reduces
04:13 sri not really
04:14 sri i can't come up with too many real world use cases i have for it
04:14 jberger mathematical mostly
04:14 mire__ joined #mojo
04:15 sri when do you need math with Mojo::DOM?
04:15 jberger my recent interest started with this: http://stackoverflow.com/a/5195485/468327
04:15 jberger revising an old SO answer
04:16 jberger and actually, I use Mojo::Collection outside of DOM applications more and more lately
04:30 jberger I still like my latest one
04:30 jberger I think its a clever solution to the problem :-)
04:39 jberger sri: a real use-case
04:39 jberger http://pastie.org/8553181
04:40 d4rkie joined #mojo
04:44 jberger well that syntax wouldn't exactly work, but you know what I mean
04:45 sri i'm out, got no use for it personally
04:46 sri thought it might be nice for oneliners extracting information from websites... but it just isn't
04:49 plenum joined #mojo
04:49 jberger http://pastie.org/8553191
04:49 jberger got even better when I used it correctly
04:50 jberger I'm not sure I'm even arguing for it for core inclusion anymore either
04:50 jberger but I'm having fun
05:06 dotan joined #mojo
05:54 dotan joined #mojo
06:49 russum1 joined #mojo
07:54 sh4 joined #mojo
08:00 Vandal joined #mojo
08:29 dotan joined #mojo
08:44 trone joined #mojo
08:53 dotan left #mojo
08:54 dotandimmest joined #mojo
09:53 denis_boyun joined #mojo
10:34 abra joined #mojo
10:42 denis_boyun joined #mojo
10:52 mire__ joined #mojo
11:06 batman https://github.com/Nordaaker/convos/issues/23 # anyone got comments on the assetpack error message discussion?
11:16 d4rkie joined #mojo
11:30 d4rkie joined #mojo
11:39 hrupp joined #mojo
12:12 plenum joined #mojo
12:18 dod joined #mojo
12:18 rem_lex| joined #mojo
12:19 dod joined #mojo
12:44 dod joined #mojo
12:48 dotan1 joined #mojo
12:48 d4rkie_ joined #mojo
13:22 asarch joined #mojo
14:17 russum1 left #mojo
14:39 jberger sri: I've thought about it over night, and I actually think I prefer my wrapper for reduce (using $_->a and $_->b) better than the $a/$b hacks
14:39 jberger http://pastie.org/8553795
14:40 jberger it works for a sort method too
14:40 jberger so I think I'm back to proposing this as a feature
14:44 jberger DDD: "The current collection object is available as $_. The a and b methods replace the traditional $a and $b."
14:45 jberger no package variable hacks, works from any caller. I think this is better than List::Util's API
14:47 jberger Mojo::Collection::reduce could actually end up being superior in that it fixes that problem
14:49 dsteinbrunner joined #mojo
15:17 russum joined #mojo
15:18 russum left #mojo
16:42 Janos joined #mojo
16:52 hummeleBop joined #mojo
16:53 mire__ joined #mojo
17:08 dotan_ joined #mojo
17:54 bowtie joined #mojo
17:55 dotan1 joined #mojo
18:09 plenum joined #mojo
18:12 klapperl_ joined #mojo
18:21 marty joined #mojo
18:30 abra joined #mojo
18:38 gryphon joined #mojo
18:41 * sri wonders if $collection->remove($oid) should be equivalent to $collection->remove({_id => $oid}, {single => 1})
18:54 bodgeex joined #mojo
19:00 bodgix joined #mojo
19:09 Mike-PerlRecruiter_ joined #mojo
19:14 bodgix joined #mojo
19:30 denis_boyun joined #mojo
19:33 bodgix joined #mojo
19:50 denis_boyun_ joined #mojo
19:51 bodgix joined #mojo
19:57 denisboyun joined #mojo
20:08 denis_boyun__ joined #mojo
20:25 denis_boyun joined #mojo
20:25 hellyna joined #mojo
20:39 lukep joined #mojo
20:55 marty joined #mojo
21:09 denisboyun joined #mojo
21:13 rem_lex|pivo joined #mojo
21:24 denis_boyun joined #mojo
21:34 dvinciguerra joined #mojo
21:34 denis_boyun__ joined #mojo
22:10 basiliscos joined #mojo
22:28 punter joined #mojo
22:28 punter Is there a web development company that works mainly with Mojolicious, looking for people to hire?
23:04 beyondcreed joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary