Re: [PHP] Quotation marks considered harmful

2006-05-05 Thread Anthony Ettinger

doesn't php have something like qq// and q// in perl?

qq = double quote interpolation
q = single quote (no interpolation)

the delimiteer / can be any character you'd like.

or, like stated previously, use a heredoc. or smarty-template engine.

On 5/4/06, Richard Lynch [EMAIL PROTECTED] wrote:

On Thu, May 4, 2006 1:53 pm, John Hicks wrote:
 Why not develop a language syntax that has distinct open and close
 string delimiters?

Because then you need to escape the closing character anyway, to have
it as data, so what did you just gain, really?

Not to mention that all the good matching possible delimiters are
already taken for Arrays, code blocks, tag start/end, and order of
operations.

--
Like Music?
http://l-i-e.com/artists.htm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Quotation marks considered harmful

2006-05-05 Thread M. Sokolewicz
thank god PHP doesn't have qq// and q//, it's one of the few things I 
can't stand in Perl (along with the 100 different ways of calling the 
same variable (@var, $var, %var, etc.). Just use a standard delimiter 
with standard, normal, quotes. It's really not that hard.



Anthony Ettinger wrote:


doesn't php have something like qq// and q// in perl?

qq = double quote interpolation
q = single quote (no interpolation)

the delimiteer / can be any character you'd like.

or, like stated previously, use a heredoc. or smarty-template engine.

On 5/4/06, Richard Lynch [EMAIL PROTECTED] wrote:


On Thu, May 4, 2006 1:53 pm, John Hicks wrote:
 Why not develop a language syntax that has distinct open and close
 string delimiters?

Because then you need to escape the closing character anyway, to have
it as data, so what did you just gain, really?

Not to mention that all the good matching possible delimiters are
already taken for Arrays, code blocks, tag start/end, and order of
operations.

--
Like Music?
http://l-i-e.com/artists.htm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Quotation marks considered harmful

2006-05-04 Thread John Hicks

John Wells wrote:

Personally, I get tired (and confused) when having to escape all of
those quotes like in the string you're trying to echo above.  Perhaps
you'd consider HEREDOC as an alternative approach:


Here's n idea I've had and never expressed publicly before. I wonder if 
some of you haven't thought the same thing:


Why not develop a language syntax that has distinct open and close 
string delimiters?


So (in an ideal world) the code in question

echo 
td width=\25%\ align=\center\
a 
href=\javascript:open_window('$php_self?action=view_recorduserid=$userid');\ 
view/a

a href=\$php_self?action=delete_recorduserid=$userid\
onclick=\return confirm('are you sure?');\delete/a/td
;

would be rendered something like this:

echo {
td width={25%} align={center}
a 
href={javascript:open_window({$php_self?action=view_recorduserid=$userid});} 
view/a

a href={$php_self?action=delete_recorduserid=$userid}
onclick={return confirm({are you sure?});}delete/a/td
};

or like this:

echo [
td width=[25%] align=[center]
a 
href=[javascript:open_window([$php_self?action=view_recorduserid=$userid]);] 
view/a

a href=[$php_self?action=delete_recorduserid=$userid]
onclick=[return confirm([are you sure?]);]delete/a/td
];

Of course, having separate characters for opening and closing double or 
single quotes would work, but that would require changing the basic 
ASCII set.


I believe some European languages use  and  as quotation marks. 
What ASCII characters do they use?


I have seen some JavaScript code that uses curly braces to delimit a 
string, but can't find that documented anywhere.


Thoughts anyone?

--J

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Quotation marks considered harmful

2006-05-04 Thread Dave Goodchild

You can:

ul

?php for ($i=0;$i=10;$i++) { ?

lilist item ?= $i; /li

?php } ?

/ul

for example

On 04/05/06, John Hicks [EMAIL PROTECTED] wrote:


John Wells wrote:
 Personally, I get tired (and confused) when having to escape all of
 those quotes like in the string you're trying to echo above.  Perhaps
 you'd consider HEREDOC as an alternative approach:

Here's n idea I've had and never expressed publicly before. I wonder if
some of you haven't thought the same thing:

Why not develop a language syntax that has distinct open and close
string delimiters?

So (in an ideal world) the code in question

echo 
td width=\25%\ align=\center\
a

href=\javascript:open_window('$php_self?action=view_recorduserid=$userid');\
view/a
a href=\$php_self?action=delete_recorduserid=$userid\
onclick=\return confirm('are you sure?');\delete/a/td
;

would be rendered something like this:

echo {
td width={25%} align={center}
a

href={javascript:open_window({$php_self?action=view_recorduserid=$userid});}
view/a
a href={$php_self?action=delete_recorduserid=$userid}
onclick={return confirm({are you sure?});}delete/a/td
};

or like this:

echo [
td width=[25%] align=[center]
a

href=[javascript:open_window([$php_self?action=view_recorduserid=$userid]);]
view/a
a href=[$php_self?action=delete_recorduserid=$userid]
onclick=[return confirm([are you sure?]);]delete/a/td
];

Of course, having separate characters for opening and closing double or
single quotes would work, but that would require changing the basic
ASCII set.

I believe some European languages use  and  as quotation marks.
What ASCII characters do they use?

I have seen some JavaScript code that uses curly braces to delimit a
string, but can't find that documented anywhere.

Thoughts anyone?

--J

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
http://www.web-buddha.co.uk

dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)

look out for project karma, our new venture, coming soon!


Re: [PHP] Quotation marks considered harmful

2006-05-04 Thread afan
You can simplify usi single instead double quotes:
echo '
td width=25% align=center
a
href=javascript:open_window(\'$php_self?action=view_recorduserid=$userid\');
view/a
a href=$php_self?action=delete_recorduserid=$userid
 onclick=return confirm(\'are you sure?\');delete/a/td
';


:)


-afan



 John Wells wrote:
 Personally, I get tired (and confused) when having to escape all of
 those quotes like in the string you're trying to echo above.  Perhaps
 you'd consider HEREDOC as an alternative approach:

 Here's n idea I've had and never expressed publicly before. I wonder if
 some of you haven't thought the same thing:

 Why not develop a language syntax that has distinct open and close
 string delimiters?

 So (in an ideal world) the code in question

 echo 
 td width=\25%\ align=\center\
 a
 href=\javascript:open_window('$php_self?action=view_recorduserid=$userid');\
 view/a
 a href=\$php_self?action=delete_recorduserid=$userid\
 onclick=\return confirm('are you sure?');\delete/a/td
 ;

 would be rendered something like this:

 echo {
 td width={25%} align={center}
 a
 href={javascript:open_window({$php_self?action=view_recorduserid=$userid});}
 view/a
 a href={$php_self?action=delete_recorduserid=$userid}
 onclick={return confirm({are you sure?});}delete/a/td
 };

 or like this:

 echo [
 td width=[25%] align=[center]
 a
 href=[javascript:open_window([$php_self?action=view_recorduserid=$userid]);]
 view/a
 a href=[$php_self?action=delete_recorduserid=$userid]
 onclick=[return confirm([are you sure?]);]delete/a/td
 ];

 Of course, having separate characters for opening and closing double or
 single quotes would work, but that would require changing the basic
 ASCII set.

 I believe some European languages use  and  as quotation marks.
 What ASCII characters do they use?

 I have seen some JavaScript code that uses curly braces to delimit a
 string, but can't find that documented anywhere.

 Thoughts anyone?

 --J

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Quotation marks considered harmful

2006-05-04 Thread Dave Goodchild

Surely you can't then interpolate the variables?

On 04/05/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


You can simplify usi single instead double quotes:
echo '
td width=25% align=center
a

href=javascript:open_window(\'$php_self?action=view_recorduserid=$userid\');
view/a
a href=$php_self?action=delete_recorduserid=$userid
onclick=return confirm(\'are you sure?\');delete/a/td
';


:)


-afan



 John Wells wrote:
 Personally, I get tired (and confused) when having to escape all of
 those quotes like in the string you're trying to echo above.  Perhaps
 you'd consider HEREDOC as an alternative approach:

 Here's n idea I've had and never expressed publicly before. I wonder if
 some of you haven't thought the same thing:

 Why not develop a language syntax that has distinct open and close
 string delimiters?

 So (in an ideal world) the code in question

 echo 
 td width=\25%\ align=\center\
 a

href=\javascript:open_window('$php_self?action=view_recorduserid=$userid');\
 view/a
 a href=\$php_self?action=delete_recorduserid=$userid\
 onclick=\return confirm('are you sure?');\delete/a/td
 ;

 would be rendered something like this:

 echo {
 td width={25%} align={center}
 a

href={javascript:open_window({$php_self?action=view_recorduserid=$userid});}
 view/a
 a href={$php_self?action=delete_recorduserid=$userid}
 onclick={return confirm({are you sure?});}delete/a/td
 };

 or like this:

 echo [
 td width=[25%] align=[center]
 a

href=[javascript:open_window([$php_self?action=view_recorduserid=$userid]);]
 view/a
 a href=[$php_self?action=delete_recorduserid=$userid]
 onclick=[return confirm([are you sure?]);]delete/a/td
 ];

 Of course, having separate characters for opening and closing double or
 single quotes would work, but that would require changing the basic
 ASCII set.

 I believe some European languages use  and  as quotation marks.
 What ASCII characters do they use?

 I have seen some JavaScript code that uses curly braces to delimit a
 string, but can't find that documented anywhere.

 Thoughts anyone?

 --J

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
http://www.web-buddha.co.uk

dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)

look out for project karma, our new venture, coming soon!


Re: [PHP] Quotation marks considered harmful

2006-05-04 Thread Richard Lynch
On Thu, May 4, 2006 1:53 pm, John Hicks wrote:
 Why not develop a language syntax that has distinct open and close
 string delimiters?

Because then you need to escape the closing character anyway, to have
it as data, so what did you just gain, really?

Not to mention that all the good matching possible delimiters are
already taken for Arrays, code blocks, tag start/end, and order of
operations.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php