Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 16, 2005 01:52:27

Jason G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] PHP Macros


Hello Internals,

Remember the ifsetor() discussion? There were many, many people for
it, and many people that did not see the point. To this day, it's
not been allowed into the source tree, and I don't see any way to
change that. So...

Please consider (some form of) this if it's possible:


define_macro square(x)
{
((x) * (x))
}

define_macro ifsetor(x, y)
{
(isset(x) ? x : y)
}

$n = square($n);


If the parser/compiler sees one of these, then it will add it to
it's list of "macros", and when it runs into the usage of one, it
will do a little token-replacing before compiling it...

Is it technically doable?

Thanks guys.

--
Best regards,
Jason Garber

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#2 Nov. 16, 2005 08:33:08

Jani T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] PHP Macros


Once we get GOTO and the ?: operator, we don't need no stinking macros! :)

--Jani


On Tue, 15 Nov 2005, Jason Garber wrote:Hello Internals,

Remember the ifsetor() discussion? There were many, many people for
it, and many people that did not see the point. To this day, it's
not been allowed into the source tree, and I don't see any way to
change that. So...

Please consider (some form of) this if it's possible:


define_macro square(x)
{
((x) * (x))
}

define_macro ifsetor(x, y)
{
(isset(x) ? x : y)
}

$n = square($n);


If the parser/compiler sees one of these, then it will add it to
it's list of "macros", and when it runs into the usage of one, it
will do a little token-replacing before compiling it...

Is it technically doable?

Thanks guys.--
Give me your money at @ <http://pecl.php.net/wishlist.php/sniper>
Donating money may make me happier and friendlier for a limited period!
Death to all 4 letter abbreviations starting with P!

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

Board footer

Moderator control

Enjoy the 18th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support