-
Notifications
You must be signed in to change notification settings - Fork 11
Suggestion: Use and Expand list literals in code (compile time) #24
Comments
👍 That is an amazing idea 😄 |
This is my suggestion for the last one. It reduces even more code & looks more like raxe syntax 😄 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 |
👍 very cool. |
Thanks 😃 |
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 😟 But like I said, there should be more people to discuss about that 😄 |
I think we should improve the LiveScript |
Regarding the new syntax for |
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
The text was updated successfully, but these errors were encountered: