Page 1 of 1

What members does a Stream* type have?

PostPosted: Wed Jul 24, 2013 8:05 am
by nerdzero
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?

Re: What members does a Stream* type have?

PostPosted: Wed Jul 24, 2013 2:13 pm
by Charles
No additional members.

Re: What members does a Stream* type have?

PostPosted: Wed Jul 24, 2013 5:18 pm
by nerdzero
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.

Re: What members does a Stream* type have?

PostPosted: Fri Jul 26, 2013 3:24 am
by Charles
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.