HaxeFoundation / haxe.org-comments

Repository to collect comments of our haxe.org websites
2 stars 2 forks source link

[haxe.org/manual] Import #88

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Import - Haxe - The Cross-platform Toolkit

Haxe is an open source toolkit based on a modern, high level, strictly typed programming language.

https://haxe.org/manual/type-system-import.html

NulllStack commented 3 years ago

according to this:

Haxe allows using a wildcard symbol .* to allow import of all modules in a package, all types in a module, or all static fields in a type. It is important to understand that this kind of import only crosses a single level as we can see in the following example

assume we have a module under mypkg.MyModule.MyModule , the wildcard import mypkg.MyModule.* only import all static fields inside the module MyModule, not "all types in a module"

NulllStack commented 3 years ago

I think you could just use import mypkg.MyModule; to import all types in MyModule ?

fy0 commented 6 months ago

Even through grammar is similar, It's very different from some common languages like javascript / python / go.

There's some tips (Haxe 4.3):

KELOTOMU commented 3 weeks ago

I'm 99% sure you can do Module alias, the documentation didn't state if it's allowed or not