Is a closure a custom function?

I just noticed that (on lucee 4.5.1.008)

isCustomFunction(function(){}) returns false

Is this the expected behaviour?

I can see that a UDF wouldn’t be a closure, but isn’t a closure a “Custom
Function”?

A distinction has been made between a UDF and a closure. You can use:
IsClosure( someVariable ) to detect closures.

I think it would be useful to have an additional validator function that
would return true for both types, IsFunction()?On 16 April 2015 at 14:10, Chris Blackwell <@Chris_Blackwell> wrote:

I just noticed that (on lucee 4.5.1.008)

isCustomFunction(function(){}) returns false

Is this the expected behaviour?

I can see that a UDF wouldn’t be a closure, but isn’t a closure a “Custom
Function”?


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/CAB%3DtfTqA4p8t2J0ZMHNeOy4a25ofZHcBS9GP2N366Pgrdwj4_g%40mail.gmail.com
https://groups.google.com/d/msgid/lucee/CAB%3DtfTqA4p8t2J0ZMHNeOy4a25ofZHcBS9GP2N366Pgrdwj4_g%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.


Pixl8 Interactive, 3 Tun Yard, Peardon Street, London
SW8 3HT, United Kingdom

T: +44 [0] 845 260 0726• W: www.pixl8.co.uk• E: info@pixl8.co.uk
Follow us on: Facebook http://www.facebook.com/pixl8 Twitter
http://www.twitter.com/pixl8 LinkedIn
http://www.linkedin.com/pixl8CONFIDENTIAL
AND PRIVILEGED - This e-mail and any attachment is intended solely for the
addressee, is strictly confidential and may also be subject to legal,
professional or other privilege or may be protected by work product
immunity or other legal rules. If you are not the addressee please do not
read, print, re-transmit, store or act in reliance on it or any
attachments. Instead, please email it back to the sender and then
immediately permanently delete it. Pixl8 Interactive Ltd Registered in
England. Registered number: 04336501. Registered office: 8 Spur Road,
Cosham, Portsmouth, Hampshire, PO6 3EB

Brilliant stuff.On 16 April 2015 at 15:13, Chris Blackwell <@Chris_Blackwell> wrote:

Thanks Micha,

That makes sense to me as i see all of those as types of custom function.

@Dominic
yes, aware of that function, but given the current implementation i have
to check both e.g

if(isClosure(obj) || isCustomFunction(obj))

given the changes Micha has indicated for Railo 5, this becomes just

if(isCustomFunction(obj))

Cheers, Chris

On 16 April 2015 at 15:07, Michael Offner <@Michael_Offner> wrote:

we have changed the functionlaity for Lucee 5.
Lucee 5 returns true for udf,closure and lambda, but we also added a new
argument “type”, so you can do:
isCustomFunction(udf,“closure”);

Micha

On Thu, Apr 16, 2015 at 3:49 PM, Dominic Watson < @Dominic_Watson> wrote:

A distinction has been made between a UDF and a closure. You can use:
IsClosure( someVariable ) to detect closures.

I think it would be useful to have an additional validator function that
would return true for both types, IsFunction()?

On 16 April 2015 at 14:10, Chris Blackwell <@Chris_Blackwell> wrote:

I just noticed that (on lucee 4.5.1.008)

isCustomFunction(function(){}) returns false

Is this the expected behaviour?

I can see that a UDF wouldn’t be a closure, but isn’t a closure a
“Custom Function”?


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/CAB%3DtfTqA4p8t2J0ZMHNeOy4a25ofZHcBS9GP2N366Pgrdwj4_g%40mail.gmail.com
https://groups.google.com/d/msgid/lucee/CAB%3DtfTqA4p8t2J0ZMHNeOy4a25ofZHcBS9GP2N366Pgrdwj4_g%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.


Pixl8 Interactive, 3 Tun Yard, Peardon Street, London
SW8 3HT, United Kingdom

T: +44 [0] 845 260 0726• W: www.pixl8.co.uk• E: info@pixl8.co.uk
Follow us on: Facebook http://www.facebook.com/pixl8 Twitter
http://www.twitter.com/pixl8 LinkedIn http://www.linkedin.com/pixl8CONFIDENTIAL
AND PRIVILEGED - This e-mail and any attachment is intended solely for the
addressee, is strictly confidential and may also be subject to legal,
professional or other privilege or may be protected by work product
immunity or other legal rules. If you are not the addressee please do not
read, print, re-transmit, store or act in reliance on it or any
attachments. Instead, please email it back to the sender and then
immediately permanently delete it. Pixl8 Interactive Ltd Registered in
England. Registered number: 04336501. Registered office: 8 Spur Road,
Cosham, Portsmouth, Hampshire, PO6 3EB


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/CAEYvUxmZiBnE%2BvuMBzhps7aORgtXwcgKjjWgD72%2BXyxQAC%2Bzrw%40mail.gmail.com
https://groups.google.com/d/msgid/lucee/CAEYvUxmZiBnE%2BvuMBzhps7aORgtXwcgKjjWgD72%2BXyxQAC%2Bzrw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.


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/CAG%2BEEByZXgUQnLxQZb65d3tuPtfGTCsGEJkRKawQ%3DzW8MzfXYQ%40mail.gmail.com
https://groups.google.com/d/msgid/lucee/CAG%2BEEByZXgUQnLxQZb65d3tuPtfGTCsGEJkRKawQ%3DzW8MzfXYQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.


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/CAB%3DtfTquK0NPTgm2Vh%2BeVacEGDNXHmzONhjVLXcx1MWut12qfg%40mail.gmail.com
https://groups.google.com/d/msgid/lucee/CAB%3DtfTquK0NPTgm2Vh%2BeVacEGDNXHmzONhjVLXcx1MWut12qfg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.


Pixl8 Interactive, 3 Tun Yard, Peardon Street, London
SW8 3HT, United Kingdom

T: +44 [0] 845 260 0726• W: www.pixl8.co.uk• E: info@pixl8.co.uk
Follow us on: Facebook http://www.facebook.com/pixl8 Twitter
http://www.twitter.com/pixl8 LinkedIn
http://www.linkedin.com/pixl8CONFIDENTIAL
AND PRIVILEGED - This e-mail and any attachment is intended solely for the
addressee, is strictly confidential and may also be subject to legal,
professional or other privilege or may be protected by work product
immunity or other legal rules. If you are not the addressee please do not
read, print, re-transmit, store or act in reliance on it or any
attachments. Instead, please email it back to the sender and then
immediately permanently delete it. Pixl8 Interactive Ltd Registered in
England. Registered number: 04336501. Registered office: 8 Spur Road,
Cosham, Portsmouth, Hampshire, PO6 3EB