clemos / try-haxe

A small webapp that allows to test Haxe online
https://try.haxe.org
MIT License
126 stars 41 forks source link

No need to instantiate a class to Try Haxe #118

Closed tariqbenezza closed 7 years ago

tariqbenezza commented 7 years ago

During my first steps in Try Haxe I waste a lot of time to undertand why something like

for (i in [1, 2, 3]) { trace(i); }

was not working.

Indeed, I didn't know that you have to instantiate a class to Try Haxe ;)

Now it's implicit

clemos commented 7 years ago

It would be nice to have a checkbox / flag for that (like [ ] script mode or something), because your detection could be quite random:

trace("class"); // ouch
elem.className += "some-stuff"; // ouch

Also, please rebase.

clemos commented 7 years ago

Also, you should move your isScript check right after checkMacros(source)

clemos commented 7 years ago

Well done :) I'll probably release it this week end :D

markknol commented 7 years ago

I didn't know that you have to instantiate a class to Try Haxe ;)

Why didn't you, I mean every example has a class. I do like the feature, but I wonder if it isn't weird to hide this while "normal" Haxe requires a class?

clemos commented 7 years ago

@markknol I wasn't too sure about this feature either (see previous comment about checkbox), but I must say it makes a lot of sense, especially for smaller snippets (code.haxe.org or haxe manual ?).

Next steps I thought of (to be discussed ;)):

clemos commented 7 years ago

So, FYI, I've done the first *, and all is online :D