DynamoDS/Dynamo — pull request #3118 by ke-yu (2014-11-17 07:21:01+00:00)
Title: Fix magn5043: ToString and String.FromObject should be combined into one node

This pull request is to fix defect [Magn 5043: ToString and String.FromObject should be combined into one node](http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-5043).

``string ToString(obj: var[]..[])`` is a built in method, so it is able to inspect run-time information of input through VM and converts it to string. For example, it can know which function that the input function pointer points to, or all properties of an instance of a zero-touch class which doesn't override ``ToString()`` method. As its parameter is arbitrary rank, it doesn't support replication.

On the other hand, ``string String.FromObject(object obj)`` is a library function, it supports replication, but it relies on csharp unmarshaller in the VM to unmarshal DS object to C# object. As csharp unmarshaller doesn't support all DS types, for example, function pointer, the best output that ``String.FromObject`` can provide is string "ProtoCore.DSASM.StackValue"` instead of more meaningful string representation like "function: foo".

There isn't a perfect solution. After discussed with Luke, we are doing the following changes -
1. Make ``ToString()`` be internal function through adding prefix ``__``. This pull request creates two internal built in functions ``__ToStringFromObject(obj: var)`` and ``__ToStringFromArray(object: var[]..var[])``.
2. Remove ``String.FromObject`` from library, and create two _**UI nodes**_ ``String.FromObject`` and ``String.FromArray``, they will be compiled to ``__ToStringFromObject()`` and ``__ToStringFromArray()`` respectively.

As now they are UI nodes, that means _**1) we can't use them in code block node (this limitation is tracked by defect [MAGN 5421](http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-5421)**_, and _**2) we can't use them in ``List.Map``**_

@lukechurch
@sharadkjaiswal

please review the change. For the second limitation, as ``String.FromObject`` now is replicatable, it is not necessary to use ``List.Map``. Do you think it is a serious problem?

The other minor thing is, to avoid they are misused in code block node, shall we move ``String.FromObject`` and ``String.FromArray`` from ``Core.String.Actions`` category to the other place (e.g., ``Core.String``)?

![untitled](https://cloud.githubusercontent.com/assets/2600379/5066351/e151584a-6e6c-11e4-9298-c97755307266.png)