Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Alternatives to sed + awk
- Date: Fri, 11 Mar 2011 10:17:46 +0100
- From: Josh Glover <jmglov@example.com>
- Subject: Re: [tlug] Alternatives to sed + awk
- References: <AANLkTim_-D9CFYC8TNp33ni85zB+QBA7jV=BpLN=4SbZ@example.com> <4D6F8D94.9040109@example.com> <87ei6nl906.fsf@example.com> <AANLkTimk1z41fSvQQmU+7fE-1Krd_kuo3_z-1SYD5rW6@example.com> <87ipvskik1.fsf@example.com> <AANLkTi=_6DoBt+xfQVOwM6KyKrxxgA_Ec9bhp751f15y@example.com> <8762rsjkdx.fsf@example.com> <AANLkTik=tHOgTRvcvNd0qsx9-o9MuqBnWUjkWVn+0U_7@example.com> <4D793EDF.2090308@example.com> <87oc5iqnuk.fsf@example.com> <4D79E218.7050301@example.com>
On 11 March 2011 09:49, Simon Cozens <simon@example.com> wrote: > When the Ruby folks say "we can write DSLs without a parser", what they mean > is option (b), "we can write DSLs that display a lot of Ruby syntax without a > parser", and therefore what they're actually saying is "we can write subroutines." Yes, but imagine a DSL such as this: xml(:doctype => 'html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"') do html do head do title { 'Awesome Page' } end body do h1 { 'Hej!' } p do "Lorem ipsum dolor sit amet, consectetur adipiscing elit." end end end end Sure, it's Ruby syntax, but it is pretty obvious to any web designer how to use the DSL, wouldn't you say? Obviously, this is a trivial DSL that has no real advantages to straight HTML, but hopefully it serves to illustrate why useful DSLs are fairly easy in Ruby. Method + block = nice DSL builder. -- Cheers, Josh
- Follow-Ups:
- Re: [tlug] Alternatives to sed + awk
- From: Simon Cozens
- References:
- [tlug] Alternatives to sed + awk
- From: Nguyen Vu Hung
- Re: [tlug] Alternatives to sed + awk
- From: Alexander Danilov
- Re: [tlug] Alternatives to sed + awk
- From: Stephen J. Turnbull
- Re: [tlug] Alternatives to sed + awk
- From: Alexander Danilov
- Re: [tlug] Alternatives to sed + awk
- From: Stephen J. Turnbull
- Re: [tlug] Alternatives to sed + awk
- From: Josh Glover
- Re: [tlug] Alternatives to sed + awk
- From: Stephen J. Turnbull
- Re: [tlug] Alternatives to sed + awk
- From: Josh Glover
- Re: [tlug] Alternatives to sed + awk
- From: Simon Cozens
- Re: [tlug] Alternatives to sed + awk
- From: Stephen J. Turnbull
- Re: [tlug] Alternatives to sed + awk
- From: Simon Cozens
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Hope everone is ok
- Next by Date: Re: [tlug] Hope everone is ok
- Previous by thread: Re: [tlug] Alternatives to sed + awk
- Next by thread: Re: [tlug] Alternatives to sed + awk
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links