Forums

What members does a Stream* type have?

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

What members does a Stream* type have?

Postby nerdzero » Wed Jul 24, 2013 8:05 am

If I have
foo as String*
and I type
foo.
in an IDE supporting code completion, what members should be displayed? Just the ones for Object or are there some additional "stream only" members that I am not aware of?
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: What members does a Stream* type have?

Postby Charles » Wed Jul 24, 2013 2:13 pm

No additional members.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: What members does a Stream* type have?

Postby nerdzero » Wed Jul 24, 2013 5:18 pm

I thought so. But would it be "wrong" to show the members for the underlying IEnumerable? :D This is what I'm doing now in a local branch of the addin that supports extension methods. So that means that in addition to the IEnumerable members, things like .first, .join, .take, etc show up. Also, it compiles and runs correctly when you use those methods.

So where should the fix go? The compiler or the addin? It wouldn't be too hard for me to add a special case for StreamType nodes to not include those members when generating the completion list, but that doesn't stop one from just typing and using them anyways; which makes me feel like they should be included in the list if they will compile.

I'm probably over-thinking this.
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: What members does a Stream* type have?

Postby Charles » Fri Jul 26, 2013 3:24 am

The reason we don't support the normal IEnumerable members--which is basically just .getEnumerator--is that "Foo*" is meant to be portable between .NET and JVM. However, we could certainly support the various extension methods on the JVM such as .first and .take, so I think including those is fine.
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 25 guests

cron