I don't know if this would be easy or hard... depends on how BYOND works internally. Anyway, my idea is that you could permit initial() to accept a type, like so:
var/myType = /obj/portable/outfit/male_outfit/business_suit
var/myVar = "name"
var/promptName = initial(myType, myVar)
What do you think?
ID:137997
May 20 2001, 4:49 am
|
|||||
Resolved
| |||||
In response to Dan
|
|
Dan wrote:
Good idea. It's on the list! Eheh, bump. This must be on a 4.0-esque list or something. >_> Hiead |
In response to Hiead
|
|
Hiead wrote:
Dan wrote: Unfortunately the one who knew how to do that was Dan. I may or may not be able to figure it out, but it's an investment of time best spent on other things to get 4.0 out the door. Lummox JR |
It would be very handy to be able to grab the initial value of a variable of a type without having to initialize the type with new().
An example possible syntax: // Syntax: If the type doesn't have the passed variable associated with it, an error should be thrown. The idea is that because you don't know what specific type you might be working with at runtime, you don't know what it might do in New(), or even what to pass it. I guess this could be worked around by not using New(), and instead writing an Init() function of some kind that you call manually when you actually want the object to exist and aren't just using a temporary copy. However, that would be a real pain in the butt, especially for libraries that don't have control over the user's coding practices. |
In response to DarkCampainger
|
|
This has been on my own wish list for a while now as well. I know I've looked into it but I don't remember where it stands. I think at the time it was just considered too minor a feature to spend time on but I definitely like the idea.
|
DarkCampainger resolved issue with message:
This became possible at some point: |
Gughunter wrote: