http://coldfusion.com logo
#cfml-general
Title
# cfml-general
a

Adam Cameron

03/22/2022, 7:12 PM
Am I correct in that CFML doesn't support import aliasing?
Copy code
import com.example.SomeThing as ExampleSomething
import me.adamcameron.SomeThing as AdamSomething
I just typed that in today assuming it would work, and was surprised when it didn't (this was on Lucee), and wondered whether I was getting it wrong. However can't find any docs, so suggests I was just imagining that I had done this before.
e

elpete

03/22/2022, 7:20 PM
It does not. :-/
I remember someone explaining to me it was because the import tag did something different than the Java or PHP import statements, but I don’t remember the details and it was years ago.
👍 1
a

Adam Cameron

03/22/2022, 7:27 PM
Yeah have def used in PHP. Probably misremembering that. I caught myself writing
var_dump
the other day 😉 Was surprised to find that Java dun't support it. But like Groovy / Scala / Kotlin do.
The comments on this S/O answer are... "interesting"... https://stackoverflow.com/a/32537545/894061. Lost of post-hoc rationalisation & apologetics if you ask me.
2 Views