|
From: Timothy J. H. <ti...@cs...> - 2004-05-24 17:33:41
|
On May 24, 2004, at 1:21 PM, Ken Anderson wrote:
> What about #{ ... #} and #[ ... #] instead?
Hmmmm. So a typical use would look like the following....
(define (js-string zzz)
#{
<script>
<!--
function qs(el)
{if (window.RegExp && window.encodeURIComponent)
{var qe=encodeURIComponent(document.f.q.value);
if (el.href.indexOf("q=")!=-1)
{el.href=el.href.replace(new RegExp("q=[^&$]*"),"q="+qe);}
else
{el.href+="&q="+qe;}}return 1;}
// --> #[zzz
#]
</script>
#}
)
The advantage is that the tokens indicating the beginning/end of string
status always
start with the # character. Yes, I think that is nicer. We then think
of #{ #} #[ #] as tokens
although #[ and #} denote the ends of strings, while #{ and #] denote
the beginnings
of strings in different contexts...
---Tim---
>
> I liked {{ because it only uses up one character, but using # would
> lets us support reader macros. I'll need to remember more of how we
> did them in CL.
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle
> 10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
> _______________________________________________
> Jscheme-user mailing list
> Jsc...@li...
> https://lists.sourceforge.net/lists/listinfo/jscheme-user
|