Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » IEvaluatedType representing an Array of a certain type
IEvaluatedType representing an Array of a certain type [message #8205] Fri, 29 June 2007 23:58 Go to next message
Shelby Sanders is currently offline Shelby SandersFriend
Messages: 13
Registered: July 2009
Junior Member
All,

I'm trying to implement my own IGoalEvaluatorFactory, and am having some
luck with regular types.

How can I return an IEvaluatedType representing and Array of a certain type?
I only see the other evaluators returning 'new RubyClassType("Array")',
which doesn't specify the Type of the contents of the Array.

This makes it so completing at the end of "myArray[0]." doesn't have type
information.

Am I missing something here?

Thank You,
Shelby Sanders
Re: IEvaluatedType representing an Array of a certain type [message #8236 is a reply to message #8205] Mon, 02 July 2007 08:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fourdman.xored.com

Hi,

By now DLTK Ruby doesn't infer types of array's contents. So there is no
IEvaluatedType implementation of such thing as "array of a certain type".

First solution, that I see, is to create RubyClassType descendant that
will have "Array%" as model key and additionally will store information
of array content type. Of course, you'll need to create such
IEvaluatedType everywhere, where variable type was inferred as Array.

Second solution is to use RubyClassType("Array") and infer array content
type only when nodes like myArray[0] are found. So no additional
IEvaluatedType are required. But I don't think that it's a good solution.

Please, feel free to ask more about this, cause I'm not sure, that I've
correctly understood your problem.

Shelby Sanders wrote:
> All,
>
> I'm trying to implement my own IGoalEvaluatorFactory, and am having some
> luck with regular types.
>
> How can I return an IEvaluatedType representing and Array of a certain type?
> I only see the other evaluators returning 'new RubyClassType("Array")',
> which doesn't specify the Type of the contents of the Array.
>
> This makes it so completing at the end of "myArray[0]." doesn't have type
> information.
>
> Am I missing something here?
>
> Thank You,
> Shelby Sanders
>
Re: IEvaluatedType representing an Array of a certain type [message #8299 is a reply to message #8236] Mon, 02 July 2007 21:16 Go to previous message
Shelby Sanders is currently offline Shelby SandersFriend
Messages: 13
Registered: July 2009
Junior Member
Mikhail,

Actually, it sounds like you do understand the situation. I just wanted to
confirm that there wasn't already a way of doing this which I happened to
overlooking.

I was thinking of extending RubyClassType with something like RubyArrayType,
so that everything which already expects a RubyClassType will still work.
This is basically the first solution you mentioned. Then, the evaluator
clients which can leverage the additional information can downcast to
RubyArrayType.

I agree, the second possibility seems like it would cause more problems than
it solves.

Is someone already working on adding this type of support? If not, I'll
give it a try, and contribute as a patch.

~Shelby


> Hi,
>
> By now DLTK Ruby doesn't infer types of array's contents. So there is no
> IEvaluatedType implementation of such thing as "array of a certain type".
>
> First solution, that I see, is to create RubyClassType descendant that
> will have "Array%" as model key and additionally will store information
> of array content type. Of course, you'll need to create such
> IEvaluatedType everywhere, where variable type was inferred as Array.
>
> Second solution is to use RubyClassType("Array") and infer array content
> type only when nodes like myArray[0] are found. So no additional
> IEvaluatedType are required. But I don't think that it's a good solution.
>
> Please, feel free to ask more about this, cause I'm not sure, that I've
> correctly understood your problem.
>
> Shelby Sanders wrote:
>> All,
>>
>> I'm trying to implement my own IGoalEvaluatorFactory, and am having some
>> luck with regular types.
>>
>> How can I return an IEvaluatedType representing and Array of a certain type?
>> I only see the other evaluators returning 'new RubyClassType("Array")',
>> which doesn't specify the Type of the contents of the Array.
>>
>> This makes it so completing at the end of "myArray[0]." doesn't have type
>> information.
>>
>> Am I missing something here?
>>
>> Thank You,
>> Shelby Sanders
Previous Topic:How do I configure the Ruby Runtime for TestCases
Next Topic:DLTK Ruby & Watir
Goto Forum:
  


Current Time: Sat Oct 19 20:30:07 GMT 2024

Powered by FUDForum. Page generated in 0.05515 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top