Wow, yes. That is a perfect explanation for all of my inquiries.
Thanks. One of my favorite things about Ruby is the "everything is an
object" design. Even native types have members. Now in C# they are
objects too, but most people don't try to use native types to perform
operations. And most native types aside from the alias string, which
is by far an exception, don't have many method attached to them. As an
example the native type int is also an alias for the object type
Int32. Using the type int or Int32 is synonymous as far as what is
available for class methods: CompareTo, Equals, GetHashCode, GetType,
GetTypeCode, and ToString. Likewise as far as static methods go they
are also the same: Equals, MaxValue, MinValue, Parse, ReferenceEquals,
and TryParse. All of these are very useful, but when we get into Ruby,
we get a whole bunch of useful methods that are not only available for
basic integer type variables, but for any variable, for example:
inspect - Returns a human readable representation of obj. If not
overridden, uses the to_s (ToString) method to generate the string.
chr - Returns a string containing the ASCII character represented by
the receiver‘s value.
even? - Returns true if int is an even number.
next, succ - Returns the Integer equal to int + 1.
odd? - Returns true if int is an odd number.
size - Returns the size in bytes of the object.
zero? - Returns true if int is equal to zero.
to_f - Converts int to a float.
to_s - Converts int to a string representation.
times - Produces an iterable sequence based on the value of int
starting with 0; used as: 5.times do |i| print i, " " end. The result
of such expression would be: 0 1 2 3 4
pred - Returns the Integer equal to int - 1.
upto - Produces an iterable sequence based on the value of int
starting with int and iterating up to and including the limit; used
as: 5.upto(10) do |i| print i, " " end. The result of such expression
would be: 5 6 7 8 9 10
Naturally, some of these are trivial calculations, like determining
whether an int value is zero: bool zero = intVal == 0; however having
these types of methods might just add some value to C#.
Nathan
On Oct 10, 11:12 am, Chris Marinos <
cmmari...@gmail.com> wrote:
> Nathan-
>
> I think you've got the right idea about the kinds of things we want to see
> in Elevate.
>
> For your question about the discrete things that we'd like to pull in from
> other languages, the answer is that we intentionally left that vague. To get
> specific about F#, I would like to see us capture all of the functions that
> they have for working with sequences captured in our APIs. For the .NET 4.0
> version, this may just mean having C# friendly APIs that call out to the F#
> implementation.
>
> I don't have as good of an answer for what we'd like to pull from Ruby,
> Haskell, Python, etc. This is mostly because I don't personally have as much
> experience with those languages. I do know that there are good ideas in
> those languages, and I'd like to incorporate as many of them as possible
> into C# with Elevate. We'd like someone to take a look at the standard
> libraries for these languages and pull over the useful bits that are missing
> from C#. That "someone" could just as easily be a developer from the
> community as it could be one of our team members.
>
> Hope that helps to clear things up a bit.
>
> -Chris
>