When I first started byond I was under the impression that the delimiter choice was up to the coder and that it really didnt matter, well over time I have found out thats a very bad assumtion.
Could someone give me a list of all the delimiter choices and what they do(Difference between each one)?
ID:178606
Apr 24 2002, 12:47 pm
|
|
In response to Lummox JR
|
|
.mob.BOB
/mob/BOB :mob:BOB *mob*BOB |
In response to Winbiko
|
|
Winbiko wrote:
.mob.BOB Those are technically called operators, not delimiters. (The term "delimiter" is usually restricted to things separating items in a list.) / is the type path separator; also the division operator. Technically its use in type paths isn't like operator, but more of a basic language construct. . and : are operators used to access vars or procs within a datum. * is used for multiplication only. Lummox JR |
In response to Lummox JR
|
|
Sorry about the term miss use.
|
In response to Lummox JR
|
|
wait. I was thinking about if those were operators and they are not. This is why they are not
I used them like a coder would use a '.' in c++. now: In C++ it is possible to overload operators such as << or + or - or >> so on so on. but you can not overload the . cause its not considered an operator. In fact here is a list of all the operators that can be overloaded: + - * / = < > += -= *= /= << >> <<= >>= == != <= >= ++ -- % & ^ ! | ~ &= ^= |= && || %= [] () new delete ( I got that from : http://www.cplusplus.com/doc/tutorial/tut4-2.html) Now I can see an arguement that that first character that tells byond that you are talking about a type could be considered a operator but not the ones used to walk through the structure. If I am wrong feel free to speak up. |
In response to Winbiko
|
|
They are called path operators.
http://www.byond.com/docs/ref/info.html#/operator/path// Some C++ operators may be overridden, but overiding is not a prerequisite to be an operator. Ironically the reference states "This is used to delimit paths in the DM code tree." |
In response to Lummox JR
|
|
I also asked this because of this:
: operator See also: . operator : path operator operators This is the runtime search operator. It is used to access a property of a var that is not explicitly prototyped. If the variable doesn't have the specified variable, a run-time error occurs. Example: var/M M = usr M:name = "futz" // access a mob property from a non-mob var and . help file says . operator See also: : operator operators This is used to access the procs and vars of a prototyped object. The variable need not actually contain a value with the specified type, but must at least be a type with the specified variable or a run-time error will occur, causing the proc to crash. Example: var/mob/M M.name = "futz" // assign 'name' mob var M.Move(0) // call 'Move()' mob proc see how they are treated different? I was wondering if there was any others. |
In response to Shadowdarke
|
|
Ah ok.
I stand corrected. Ya I just looked it up too =P The DM operators are: [] () . / : ~ ! - ++ -- ** * / % + - < <= > >= << >> == != <> & ^ | && || ? = += -= *= /= &= |= ^= <<= >>= |
Delimiters for what, exactly? For URL query strings? Lists?
Lummox JR