Front page | perl.perl6.internals.api.parser |
Postings from December 2000
Re: Now, to try again...
Thread Previous
|
Thread Next
From:
Nick Ing-Simmons
Date:
December 19, 2000 02:22
Subject:
Re: Now, to try again...
Message ID:
200012191022.KAA14966@mikado.tiuk.ti.com
Sam Tregar <sam@tregar.com> writes:
>
>It comes down to what is meant by "little language". When I hear that
>term I immediately think Scheme and TCL. They both have a small core and
>extremely regular syntax. I can imagine writing a smallish parser that
>spits out Perl bytecode for either.
TCL is surprisingly hard to get right. The parse is trivial
but typical Tcl code uses the quoting mechanisms to creatively
create variable names at the various interpolation times.
This kind of mess (syntax from rusty memory):
proc messy {name suffix level value} {
set command "$name$suffix"
upvar $command [expr $level-2]
set command "$command {$value}"
set $command
}
messy foo "[$index]" 3 {expr $command+1}
That "obviously" compiles to the bytecode for
$foo{$index}++
;-)
--
Nick Ing-Simmons <nik@tiuk.ti.com>
Via, but not speaking for: Texas Instruments Ltd.
Thread Previous
|
Thread Next