BIF argument order unpredictable

I have a UDF that takes any number of arguments and creates an ordered
MongoDB BasicDBObject from them. This works well but if I install this as a
BIF the order of the arguments is inconsistent, creating an incorrectly
ordered result.

Is this intended behavior or a bug? Seems to me the arguments should be in
correct order no matter what?

Example:

dump(var:MongoDBObjectUDF("arg1":1, "arg2":1), label:"UDF") dump(var:MongoDBObjectBIF("arg1":1, "arg2":1), label:"BIF")

I’m dumping the argument collection within each function as well as the
dump of the result.

Arguments to UDFScope Argumentsarg11number1arg22number1
UDFMap (com.mongodb.BasicDBObject)stringarg1number1stringarg2number1
Arguments to BIFScope Argumentsarg21number1arg12number1
BIFMap (com.mongodb.BasicDBObject)stringarg2number1stringarg1number1

I don’t think there’s anything special about the arguments scope; it’s just
a structure like anything else, and you aren’t supposed to rely on the
order of the keys. (This enhancement would change that, however:
https://luceeserver.atlassian.net/browse/LDEV-113 .)

On the other hand, does it matter that the MongoDB map has disordered keys?
(I don’t know MongoDB.)On Wed, Sep 9, 2015 at 11:29 AM, Sean Daniels <@Sean_Daniels> wrote:

I have a UDF that takes any number of arguments and creates an ordered
MongoDB BasicDBObject from them. This works well but if I install this as a
BIF the order of the arguments is inconsistent, creating an incorrectly
ordered result.

Is this intended behavior or a bug? Seems to me the arguments should be in
correct order no matter what?

Example:

dump(var:MongoDBObjectUDF("arg1":1, "arg2":1), label:"UDF") dump(var:MongoDBObjectBIF("arg1":1, "arg2":1), label:"BIF")

I’m dumping the argument collection within each function as well as the
dump of the result.

Arguments to UDFScope Argumentsarg11number1arg22number1
UDFMap (com.mongodb.BasicDBObject)stringarg1number1stringarg2number1
Arguments to BIFScope Argumentsarg21number1arg12number1
BIFMap (com.mongodb.BasicDBObject)stringarg2number1stringarg1number1


See Lucee at CFCamp Oct 22 & 23 2015 @ Munich Airport, Germany - Get your
ticket NOW - http://www.cfcamp.org/

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/95c6a4e4-6f31-4f90-8e43-c589687c5ba3%40googlegroups.com
https://groups.google.com/d/msgid/lucee/95c6a4e4-6f31-4f90-8e43-c589687c5ba3%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.