Ok, I've tried at length to explain my insanity elsewhere, and bored a lot of people into not listening with walls of text. So I'm going to try and be as concise as possible here, still hopeful to start a code-fire that burns down the whole forest...
ABSTRACTION MAKES ME A HAPPY WEB DESIGNER!!!!
The following is just a suggestion, not working code it might be syntactically wrong, I'm trying to paint you a picture of something beautiful that I want to share very badly.
use abstractor; #there is no real name yet
my $output = abstractor->new();
$output->load_definitions(
# dirpath to definitions dir
);
#or
$output->add_definitions ( { a => 'print "HELLO"',
b => 'print "WORLD"',
c => 'print "!!"' } )
$output->compute("<a></a> <b></b> <c></c>");
HELLO WORLD!!
Can you see what that does? I hope so!! The rabbit hole goes deeper, please bear with my idi0cracy.. I want to give this to you but I don't know how to explain it better than this!
$output->add_definitions ( { a => '$result = "HELLO"',
b => '$result = "$data WORLD"',
c => '$result = "$data!!"' } )
#$data is the string inside the tag so if you have a
#tag <b> which contains the string "HELLO", then $data
#will be equal to "HELLO" when the tag is being computed
print $output->compute("<html>
<head></head>
<body>
<c><b><a></a></b></c>
</body>
</html>");
#the interpreter ignores tags that it does not have #definitions for
Output :
<html>
<head></head>
<body>
HELLO WORLD!!
</body>
</html>
$output->add_definitions ( { a => '$result = "HELLO"' });
print $output->compute("<a></a> <a></a> <a></a>\n");
print $output->compute("<a><a><a></a></a></a>\n");
HELLO HELLO HELLO
HELLO
$output->add_definitions
(
{ a => '$result = "<html>$data</html>"',
b => '$result = "<body>$data</body>"',
c => '$result = "HELLO WORLD!!!"'
});
print $output->compute("<a><b><c></c></b></a>\n");
<code>
Output :
<code>
<html><body>HELLO WORLD!!</body></html>
Does it start to make any sort of sense yet? What I'm talking about here is not a framework, altho I have built a framework out of it (it's too slow using my naive methods)
This abstraction method along with just another couple of quirks makes me able to build very complex sites out of completely reusable code blocks, and the abstract xmlesque code is completely operating system and even implementation language agnostic!
Come on someone out there must get it!
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.