Open kobi2187 opened 8 years ago
:+1: That is an amazing idea :smile:
This is my suggestion for the last one. It reduces even more code & looks more like raxe syntax :smile:
import
openfl:
display: Bitmap, Sprite
events: Event, KeyboardEvent
ui: Keyboard
Assets
end
wow, I like your style. very aesthetic!
Following the same idea, this:
import luxe.Input
import luxe.Scene
import luxe.Sprite
import luxe.Visual
import luxe.Color
import luxe.Vector
import luxe.AppConfig
import luxe.Particles
import luxe.Entity
import luxe.Text
import luxe.structural.Pool
import luxe.structural.Bag
import luxe.options.GeometryOptions
import states.*
import mint.Control
import mint.types.Types
import mint.render.luxe.LuxeMintRender
import mint.render.luxe.Convert
import mint.layout.margins.Margins
would become:
import
states: *
mint:
render.luxe: LuxeMintRenderer, Convert
layout.margins: Margins
types: Types
Control
luxe:
structural: Pool, Bag
options: GeometryOptions
Input, Scene, Sprite
Visual, Color, Vector
AppConfig, Particles, Entity
Text
end
:+1: very cool. one last final touch: I notice that package and class names can't have spaces in them, so it will not be ambiguous to remove the ',' commas and use whitespace (space or tabs) as separation. ok, maybe i'm taking this too far already. I like your syntax suggestions they look nicer than the original proposal in my opinion. good job :-)
Thanks :smiley: In my opinion, I think the separation is easier to see with the commas, but it could be optional, so it fits everyone's style :smile:
This
import
states: *
mint:
render.luxe: LuxeMintRenderer, Convert
layout.margins: Margins
types: Types
Control
luxe:
structural: Pool, Bag
options: GeometryOptions
Input, Scene, Sprite
Visual, Color, Vector
AppConfig, Particles, Entity
Text
end
Looks more like CoffeeScript object notation, what about this? I know I am adding useless things there, but it is just because to make sense
import [
openfl.[
display.[ Bitmap, Sprite ],
events.[ Event, KeyboardEvent ],
ui.Keyboard,
Assets,
]
]
So the first example would become this:
import [
states.*,
mint.[
render.luxe.[LuxeMintRenderer, Convert],
layout.margins.Margins,
types.Types,
Control,
], luxe.[
structural.[Pool, Bag],
options.[GeometryOptions],
Input, Scene, Sprite,
Visual, Color, Vector,
AppConfig, Particles, Entity,
Text,
],
]
I think that both of the solutions are great, the only problem is that there is not enough people to discuss about it :worried: To me, the fact that it looks like CoffeeScript object litterals doesn't really matter. In fact, I think looks cleaner.
But like I said, there should be more people to discuss about that :smile:
I think we should improve the LiveScript require!
syntax so that it fits Spoon and Haxe to reduce the ammount of import
statements.
I hate big import
lists and the current Spoon syntax for import
statements doesn't help :smile:
Regarding the new syntax for import
, I've reworked the syntax found here and opened #26 so that we can discuss it together :)
When looking for packages or including interfaces, use the list literal [ list literal ]. And then expand to single lines.
the first line becomes:
class @ :: [ Hello , World ]
the same should be done for import.
can be written as:
This means to parse the line and create multiple lines according to the list part. that is, expand it.
other possibilities for syntax:
import openfl/events/[ Event, KeyboardEvent ]
import openfl.(events|ui).something #something is in both of them.
can have other .* regular expressions. This will mean that raxe will have to scan the directories or packages to retrieve everything that matches.While we're on this subject of reducing code amount, the word "import" repeats every line. what do you think about something along these lines?
seems cleaner to me