like the Float.pow function in kotlin, in normal cases, which the pow function is not a part of since it is an extension function, you do it by doing, kotlin.math.abs for instance, should import directives be compulsory for code golf submissions? (like a string of imports such as import javax.swing.Jframe;fun main(){ etc.? or should they be ignored as many other languages dont have those functions under libraries anyway? Now, if they are ignored, the tio.run's would be broken. but maybe the import statements could be done at the footer section that so nothing breaks?

Also, for the extension functions, in kotlin atleast. you cant call them by doing kotlin.math.pow(2f, 4) or something. when you type in 2f.pow(4f) and press enter, the ide, -atleast for my case- imports it automatically, and i doubt if there is a standalone way to use extension functions in kotlin. so... how should they be treated in your opinion?

  • 1
    \$\begingroup\$ It's not clear to me what is being asked here. Import statements are generally required and contribute to the score. It does not matter what your editor might autocomplete only the size of the actual source code. I don't know if that answers your question. \$\endgroup\$
    – Wheat Wizard Mod
    Jan 28, 2022 at 15:12
  • \$\begingroup\$ but the thing is, in some languages, basic functions such as mathematical functions aren't locked under a library but in some they are. is this really necessary? \$\endgroup\$ Jan 28, 2022 at 15:19
  • \$\begingroup\$ also what about extension methods from other standart libraries? you need to import them no matter what, you cant even call it standalone \$\endgroup\$ Jan 28, 2022 at 15:20
  • 2
    \$\begingroup\$ If you don't like basic functions being locked behind imports then don't use languages that lock them behind imports. We are not in the business of making things fair between languages because code-golf is not about competing between languages. It's about making the best answer you can with the tools you choose. \$\endgroup\$
    – Wheat Wizard Mod
    Jan 28, 2022 at 15:25
  • \$\begingroup\$ See this. \$\endgroup\$
    – emanresu A
    Jan 28, 2022 at 18:57
  • \$\begingroup\$ so I gotta include all, okay, but what about extension functions, the same thing applies to them too? \$\endgroup\$ Jan 29, 2022 at 10:22


Browse other questions tagged .