PureBasic Forum
http://forums.purebasic.com/english/

Macros - nested definitions not supported
http://forums.purebasic.com/english/viewtopic.php?f=37&t=72679
Page 1 of 1

Author:  Little John [ Fri Apr 19, 2019 7:04 am ]
Post subject:  Macros - nested definitions not supported

I think it would make sense to mention in the official documentation of Macros, that PB does not support nested Macro definitions. Otherwise, pointless discussions and "bug reports" about this topic will keep coming up on the forum.

Author:  Josh [ Fri Apr 19, 2019 4:23 pm ]
Post subject:  Re: Macros - nested definitions not supported

+1

Author:  kurzer [ Fri Apr 19, 2019 5:25 pm ]
Post subject:  Re: Macros - nested definitions not supported

+1, but...

That would be good, but then the compiler should also output a meaningful error when trying to create a nested macro.

In one of the 'pointless discussions' you mentioned, it was discovered that the compiler actually is not prepared for this constellation and does not behave in a comprehensible way. (viewtopic.php?f=13&t=72669)

Counterexample:
If one currently try to assign a numeric value to a string variable, the compiler will tell you clearly WHAT exactly you just did wrong. But it doesn't do that in case of wrongly used macros.

Author:  davido [ Fri Apr 19, 2019 6:47 pm ]
Post subject:  Re: Macros - nested definitions not supported

+1

Author:  Little John [ Fri Apr 19, 2019 7:16 pm ]
Post subject:  Re: Macros - nested definitions not supported

kurzer wrote:
+1, but...

That would be good, but then the compiler should also output a meaningful error when trying to create a nested macro.

I absolutely agree.
When the compiler encounters things that it does not support, it should generate meaningful error messages. That would make our lifes as programmers considerably easier. :-)

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/