Hi all,
I am trying to make a very simple list oriented language (well more like preprocessor ala m4), I think there is a very "natural" solution (something that basically writes itself) to what I am looking for, but I was wondering if I could get some help fleshing out the idea.
Basically, I would just want to define list assignment, functions and function application over lists that is very \n delimiter oriented, with the default interpolation behaviour to take cross-products. This would be pseudo example, the idea being that the syntax would be very lightweight over a normal text file...
As->{
1
2
3
4
5
}
Bs->{
6
7
8
9
}
AsBs
>>16
27
38
49
5
x-> is some number
6x
>>6 is some number
6{1,2,3,4}
>>61
62
63
64
level1a->{
A
AA
}
level1b->{
B
BB
}
level2->{
level1a level1a
level1a level1b
}
level2
>>A A
A AA
AA A
AA AA
A B
A BB
AA B
AA BB
I am not sure exactly how well I've thought this out, but it gives you an idea...it's basically just subsitition with and emphasis on cross products that is sacrifices some flexibility for simplicity by imposing things like new line delimiters.
I am just a little flustered in terms of where to start doing this "the right way". Am I supposed to do this in recdescent? Is there a way to extend/modify perl's syntax so I can get things like regex's in my function definitions?
Is there an obvious way to do this without perl?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.