Well, this is just for a proof of concept i was trying to make... about a
week ago someone asked if it was possible to make Class load script files on
creation. The only problem i can find with this is that normally you would
pass Extend and Implement objects, but for this kind of  operation to work
you would have to pass strings instead (since trying to pass an unloaded
object will result in an error).

the way i see it, this requires one of 2 things:
1. an ability to create a Class factory that will load the files and then
create a new class with the right parameters (which is what i'm trying to
do).
2. a rewrite to to the Class file, that will also accept strings and will
attempt to load them .

I've also tried to do Class.apply and Class.constructor.apply, but they both
thrown errors. guess i'll have to pass on it...
again - this is an exercise. I'm not trying to do the most practical thing,
just trying to find a challenge...
-----------
אריה גלזר
052-5348-561
5561


On Wed, Apr 14, 2010 at 00:48, Aaron Newton <[email protected]> wrote:

> Without looking at your code I would say you are fighting too hard.
> Whatever you are doing, you're pushing against the MooTools design pattern.
> I would reconsider your approach.
>
>
> On Tue, Apr 13, 2010 at 2:31 PM, אריה גלזר <[email protected]> wrote:
>
>> sadly, this doesn't help me... i am trying to modify Class with a wrapper
>> factory (so it could be used as a plugin), and this requires an unknown list
>> of parameters...
>> -----------
>> אריה גלזר
>> 052-5348-561
>> 5561
>>
>>
>> On Tue, Apr 13, 2010 at 22:19, Christoph Pojer <[email protected]
>> > wrote:
>>
>>> This is not a MooTools limitation but a JavaScript limitation. You
>>> cannot use call or apply on constructor functions. Alternatively you
>>> can pass a fixed amount of arguments like
>>>
>>> new MyObject(arg, arg1, arg2, ...)
>>>
>>> Or create a separate method that sets up your instance with all the
>>> necessary functionality like
>>>
>>> var obj = new MyObject;
>>> obj.setup.apply(obj, arts)
>>>
>>> On Apr 7, 1:38 pm, אריה גלזר <[email protected]> wrote:
>>> > hey. i want to create a costum factory for a specific Class that
>>> requires me
>>> > to pass through its mutators before passing them to the Class . the
>>> thing
>>> > is, Class requires me to use the 'new' operator, which in turn doesn't
>>> allow
>>> > me to use run/apply etc. so - how can i pass a modified list of
>>> paramaters
>>> > to an object that requires the use of 'new'?
>>> >
>>> > hope i'm clear on this...
>>> > -----------
>>> > אריה גלזר052-5348-561
>>> > 5561
>>>
>>>
>>> --
>>> To unsubscribe, reply using "remove me" as the subject.
>>>
>>
>>
>

Reply via email to