ID:132765
 
The \ref macro's behavior of returning an object's tag if it is set can be annoying. This is especially true if multiple objects have the same tag, since there is no way to differentiate between them. Generally this should be avoided anyways, but the map editor silently sets an object's tag if it has been created via right clicking and choosing 'Generate Instances From Directions' or 'Generate Instances From Icon States'. For example, take this code:
/obj/door
var/open=0
Click()
if(get_dist(usr, src)>1) return
var/html="<a href='byond://?src=\ref[src];open=1;'>Open!</a>"
usr<<browse(html)

Topic(href, href_list)
if(href_list.Find("open"))
src.Open()


If two door objects are created by using one of the above options, then they may both end up with the same tag. This means that when the user clicks the 'Open!' link, the door the user didn't click may be the one that actually opens. This would be prevented if \ref returned a unique string for each object.
From what I was told, each object has it's own unique "tag"
the tag depends on when the object was spawned from what I remember. the first object spawned probably has only numbers- and that number increases, or a letter is added or whatever. or am I just crazy?
Seconded, I guess - I actually considered requesting this myself.
All that needs to be said is that you can freely get an object's tag on your own, but you can't get its memory/text reference without using \ref.
However, on the other hand, changing this could be a little backwards-incompatible in old source code that might actually depend on this (but that would be very rare), and you can easily work around this annoying behavior.
In response to Super Saiyan X
You're confused.
There are 2 separate kinds of text strings the \ref text macro can return:
1) The object's tag var (it's a built-in var most types have (even some non-datums), look it up).
2) A memory reference to the object (as text). This is the one you speak of.

Both of these can (and are primarily intended to) be used in an identical manner with locate() in order to find the object (get back a usable reference to it).