HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why can't textmacros be nested?

04-14-2008, 12:10 AM#1
PandaMine
SImply as the thread title states, is there any reason why textmacros cant be nested apart from the nuisance of having to program it?

Reason im asking is recently there were many cases were I would have liked to use the ability to nest textmacros (such as the template used in my AMHS)

It would give a huge boost to making macro templates and many other things
04-14-2008, 12:09 PM#2
MaD[Lion]
yes nested textmacros and other textmacro fancies will totally own... basically vjass is only textmacros..
I want textmacros to be nested. And to be able to use //! If DEFINED or something.
04-14-2008, 12:15 PM#3
TheDamien
Quote:
Originally Posted by MaD[Lion]
basically vjass is only textmacros..

Zzzzzz.
04-14-2008, 12:18 PM#4
Vexorian
Quote:
It would give a huge boost to making macro templates and many other things
This is the reason.
04-14-2008, 02:57 PM#5
PandaMine
Quote:
Originally Posted by Vexorian
This is the reason.

Why it should be implemented ........ ?
04-14-2008, 09:25 PM#6
Strilanc
He's commenting on the fact that people will abuse it to write code that deserves to be shot.

But frankly, only the mapper has to look at the code. I don't think the ability to abuse readability should be a huge design concern in vJass. Mappers that like readability (like me) will avoid excessive nesting.
04-14-2008, 11:33 PM#7
PandaMine
Quote:
Originally Posted by Strilanc
He's commenting on the fact that people will abuse it to write code that deserves to be shot.

But frankly, only the mapper has to look at the code. I don't think the ability to abuse readability should be a huge design concern in vJass. Mappers that like readability (like me) will avoid excessive nesting.

People can program horrible code in vJASS and deserve to get shot. It should be the programmers fault and not the system itself for creating bad code unless the system explicitly forces programmers to create bad code

Nesting textmacros in my opinion wouldn't force people to create bad code, yes it gives the possibility but so do many other things.In my opinion the advantages would far outweigh the disadvantages.

And like you said, only the mappers will look at the code. So if anything horrible happens they should be shot
04-15-2008, 03:57 AM#8
TheDamien
I agree with PandaMine. If people really want to write unreadable code there is nothing stopping them from abusing the existing vJass features, naming all their functions after porn stars, replacing ifs with loops+exitwhens, etc.
04-16-2008, 07:28 AM#9
PandaMine
Quote:
Originally Posted by TheDamien
I agree with PandaMine. If people really want to write unreadable code there is nothing stopping them from abusing the existing vJass features, naming all their functions after porn stars, replacing ifs with loops+exitwhens, etc.

Yeah I hope we manage to convince Vex, cos nesting textmacros would be really really really handy
04-16-2008, 08:12 AM#10
Tide-Arc Ephemera
To be perfectly honest, is WC3 about codes or maps? Even if it's both, the author of the map should be able to make it however he sees fit.
04-16-2008, 12:23 PM#11
Vexorian
I couldn't care less about unreadable code. I just don't want people to actually use textmacros, so allowing nesting would be counter productive. Besides, I would need to rewrite the textmacro parser or make it iterative until no more nested //!runtextmacro are found...
--
WC3 is about maps, but maps are about codes, if you make your code unmaintainable your map won't last, you will eventually have to drop it.
04-17-2008, 12:31 PM#12
MaD[Lion]
preproccessor is actually just copying existing jass codes and bunch it together...
Why cant u allow us to use vjass in the preprocessor level. It would be really great. coding would be easier. Just dont call them textmacro. Cus atm its really hard to link 2 structs together (extends).
if struct B extends struct A. And you have a system that loop trought structs periodically. You can only loop trought the type of struct A. so B extends A will be useless.
Because extends is used so people can extend the existing struct so they can easier add member variables, or their own method. To link to other stuffs.
But atm i have no way of doing so, ive tried to play with textmacro, but no help. Not as it is now.

And u say textmaro map wont last. Look at MaDOS. It is used by many people, even those who doesnt know Jass. Thanks to textmacro everything just become totally easy.
And look at MBA (MaD Balls Arena), there are even clans for it in US EAST.
04-17-2008, 12:58 PM#13
Vexorian
Quote:
And u say textmaro map wont last
I didn't say that.
Quote:
--
Separates unrelated things, I was replying to Tide after he said maps are not about codes.

Quote:
if struct B extends struct A. And you have a system that loop trought structs periodically. You can only loop trought the type of struct A. so B extends A will be useless.
You are going to need to ellaborate about this issue much more, since if I understood you correctly you are wrong and that's actually quite possible.

New reason not to allow nested textmacros: people will try to use it as a replacement for extends.

--
Anyways, I am just saying, this is the formula I use to decide whether to implement something:

(Motivation to implement it) / difficulty

nested textmacros return a very low value, mostly because I am yet to actually need that stuff. And don't tell me you'd like it as a way to have templates, cause I am planning to implement templates separatedly.

Since I'll eventually make another compiler adding nested textmacros shall be easier then, in that case I might implement them.
04-17-2008, 01:20 PM#14
MaD[Lion]
oki oki. do wat u must. but i really need tat extend thing to work...

if i have an array of struct type A.
and i wanna create new objects of B (which is extended from A). I wanna loop trough all objects tat is A or B or anything tat extends A. how do i do tat...
04-17-2008, 01:44 PM#15
Vexorian
That really is possible, and if it isn't ,it is either a bug or you wanted interfaces. But that's the sort of thing I tested first after adding extends...