/wiki/Programming_with_Moose/Syntax/has#Clearing_up_confusion
--
Evan Carroll - m...@evancarroll.com
System Lord of the Internets
web: http://www.evancarroll.com
ph: 281.901.0011
-side MVC, YUI,
HTML 5, etc) and NoSQL database technologies (MongoDB specifically, but
document oriented DBs in general, accompanied by interesting stuff like
ElasticSearch).
Excellent, where do I send my application? I have experience with all
that stuff except Bread::Board.
--
Evan Carroll
']
, default = 5
, column = 'foo'
);
Where the attribute trait column provided by DBKey, coerces to DBCol
the same way that the above columns would: this would require the
ability to access the classes database, schema, table, and again the
singleton for the dbh.
--
Evan Carroll - m...@evancarroll.com
an `override_or_after 'BUILD' = sub {}`?
I've just got an Attribute Trait which I want to set from within in a
role, I do that currently by wrapping BUILD.
--
Evan Carroll - e...@dealermade.com
System Lord of the Internets - Dealermade
web: http://www.dealermade.com
ph: 888.403.9143
11:14 @mst sub BUILD {} after BUILD = sub {
Amusing...
sub BUILD {'amusing hack'}; after 'BUILD' = sub {}
it is.
--
Evan Carroll - e...@dealermade.com
System Lord of the Internets - Dealermade
web: http://www.dealermade.com
ph: 888.403.9143
line after it does my image declaration, it has a default but
no native trait.
has 'images' = ( is = 'rw', isa = 'ArrayRef[URI]', default = sub {
[] }, auto_deref = 1 );
What's going on? Moose version 1.17
--
Evan Carroll - m...@evancarroll.com
System Lord of the Internets
web: http
confusion.
Overall, it was too much magic for no particular gain.
Good decision, and easy fix.
--
Evan Carroll - m...@evancarroll.com
System Lord of the Internets
web: http://www.evancarroll.com
ph: 281.901.0011
I personally use initializer a lot in my Moose code, yet I hear a lot
of people saying negative things about it? What's wrong initializer
and is it going away? I often find its hook-choice more useful than
trigger.
--
Evan Carroll - m...@evancarroll.com
System Lord of the Internets
web: http
. I don't even read initialization as
being an apt choice of words for setting foo, via
Class-new({ foo = bar })
I'm not sure if this misunderstanding is unique to myself or not, but
I didn't take your statement (or the docs) to be at odds with my own
mental model of Moose behavior.
--
Evan
provides no gain whatsoever.
--
Evan Carroll - m...@evancarroll.com
System Lord of the Internets
web: http://www.evancarroll.com
ph: 281.901.0011
.
(28-2) / 11.0
2.3636363636363638
Seriously, MooseX::Declare adding less than 2.36 seconds to start up
on an old machine.. That's the post..
--
Evan Carroll - m...@evancarroll.com
System Lord of the Internets
web: http://www.evancarroll.com
ph: 281.901.0011
I'm sorry, where is the benchmark? Does it use the type system?
Coercions? Method signatures? I didn't see it in the attached links
and I feel without it this is a rather bad post... Does your use of
the term run include startup costs? Or, is this a runtime benchmark?
--
Evan Carroll - m
of
River Obnoxious.
--
Evan Carroll - m...@evancarroll.com
System Lord of the Internets
web: http://www.evancarroll.com
ph: 281.901.0011
it going one step further and to make a
special token for this.
use MooseX::Autoname qw(generate_by_name);
has foo = (
isa = Str
, is = rw
, predicate = generate_by_name
, builder = generate_by_name
);
Or, something.
--
Evan Carroll - m
in perl? Wouldn't this code be better in
List::Util? Why should Moose have the sanitation features here? I'd be
more interested in reading more about this optimization. I've never
seen any code on CPAN do it.
--
Evan Carroll - m...@evancarroll.com
System Lord of the Internets
web: http
to do with the *function* of the module.
A Trait isn't all that far from any other module that uses SubExporter
for method-install. Should we give those a separate namespace?
--
Evan Carroll - m...@evancarroll.com
System Lord of the Internets
web: http://www.evancarroll.com
ph: 281.901.0011
/~flora/Class-MOP-1.03/lib/Class/MOP/Instance.pm
--
Evan Carroll
System Lord of the Internets
On Tue, Jun 22, 2010 at 1:15 PM, Karen Etheridge p...@froods.org wrote:
On Tue, Jun 22, 2010 at 10:48:21AM -0500, Evan Carroll wrote:
And the forbidden Triple Jeopardy question? What ways can you have
prevented this with a much more simplistic failure?
I believe it has already been said
I'm trying to create a Date type, and one of the coercions I wanted
was from a DateTime object. I can't get it to work.
I believe your problem is UTC vs floating. -from_epoch asserts the
time_zone is UTC unless provided. All other calls to new are
implicitly floating time_zones.
--
Evan
I see those tests are a waste. The deal is this then:
subtype MyDate, as Object;
What you need to do is subclass DateTime, and make subtype MyDate
require that type, then coerce from type DateTime.
--
Evan Carroll
System Lord of the Internets
? Should an API expose a worm
attribute as a rw attribute? Or, should it be exposed as a ro
attribute?
--
Evan Carroll
System Lord of the Internets
-has_bar
;
}
--
Evan Carroll
System Lord of the Internets
http://www.evancarroll.com
on moose-attributes).
--
Evan Carroll
System Lord of the Internets
http://www.evancarroll.com
consistency throughout the program and
anything that subclasses it.
has 'attribute' = ( isa = 'Str', is = 'ro', predicate = 'has_attribute' );
around 'attribute' = sub {
my ($next, $this, $key) = @_;
$self-has_attribute ? die 'exception' : $this-$next($key);
};
--
Evan Carroll
System Lord of the Internets
that was me being a dumb ass.
has 'attribute' = ( isa = 'Str', is = 'rw', predicate = 'has_attribute' );
around 'attribute' = sub {
my ($next, $this, $key) = @_;
if ( $key ) {
$self-has_attribute ? die 'exception' : $this-$next($key);
}
else {
$this-$next
}
};
etc.,
--
Evan Carroll
::MOP::Attribute's get_value which requires a
class name. This is odd, I just want to read from the sucker, in the
source of Mooose::Meta::Attribute I see this return
$self-SUPER::get_value($instance) which seems to imply the instance
is being set, but it isn't working. Any ideas?
--
Evan Carroll
demonstrate anything.
--
Evan Carroll
System Lord of the Internets
http://www.evancarroll.com
Have to agree with Evan here, without a reproduce-able example we can't turn
it into a test and possibly fix it :)
The always agreeable Evan.
--
Evan Carroll
System Lord of the Internets
http://www.evancarroll.com
would be just as useful. There are at least a few
examples of where as a developer I was stung with stuff that was
currently supported but deprecated, supported but retarded, or
implemented but unsupported.
--
Evan Carroll
System Lord of the Internets
http://www.evancarroll.com
29 matches
Mail list logo