Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

TML: One step closer to S-expression markup

Name: Anonymous 2013-01-04 22:40

https://github.com/judnich/TupleMarkup#readme

What does /anus/ think? Personally, I don't like the |, but some people may think it makes the language more human readable.

Isn't the parser a bit too long? How long is an actual S-expression parser in C?

Found it after clicking /r/programming accidentally in a comment section of some gay website I don't want to share.

Name: Anonymous 2013-01-04 22:43

Nesting Delimiter

The bar | delimiter creates a nested tuple out of each section it separates. For example:

[ position | 1 2 3 ]

is equivalent to:

[ [position] [1 2 3] ]

~~~~

NO THANKS

Name: Anonymous 2013-01-04 22:45

Why the fuck is it so hard to make HTML use actual S-expressions with parentheses? Why won't these Redditors cut the fucking crap already?

Why? Why?

Name: Anonymous 2013-01-04 22:48

>>3
How do you distinguish between attributes and nested tags, huh?

Name: Anonymous 2013-01-04 22:53

>>4
attributes
Back to the W3C, Shlomo.

Name: Anonymous 2013-01-04 22:54

>>4
By not using useless cruft like attributes.

Name: Anonymous 2013-01-04 22:57

It's not hard to convert S-exps to HTML.

https://dis.4chan.org/read/prog/1348433870/

>>4
My solution is to treat symbols as tag and attribute names, and strings as text nodes and attribute values.

(tag-name attr1-name "attr1 value" attr2-name "attr2 value" "text node 1" "text node 2" (tag2-name ...))

An element is either a list or string (text node). If the element is a list, it must start with a symbol (the tag name). If the next element is a symbol, it's an attribute, and must be followed by a string, its value. If the next element is not a symbol, then it's a nested element.

I haven't found any limitations to this approach, other than all attributes must have values.

Name: Anonymous 2013-01-04 23:02

>>7
Elegant as fuck.

I love your posts! I read them 5 times! Please POST MORE.

Name: Anonymous 2013-01-04 23:07

There's something I've always wondered.

If I want to make something like what >>8-san did, I'd have to do it like this:


[b]
[i]
    [o]
    POST
    [/o]
   
    [o]
    [u]
      < space
    [/u]
    [/o]

    [u]
    MORE
    [/u]
[i]


to achieve the wanted result.

Would it be possible to avoid the repetition? Something like

(b.i
    (o "POST" (u " ") MORE)
)

would explode not-gracefully with most parsers. I can't really think of any other way of avoiding this. Maybe HTML allows that?

Name: Anonymous 2013-01-05 0:13

Name: Anonymous 2013-01-05 10:21

(hax anus)

Name: Anonymous 2013-01-05 12:03

>>9
Yes, HTML allows that.

http://www.w3schools.com/cssref/tryit.asp
Please <b><i><span style="text-decoration:overline">POST<u> </span>MORE</u></i></b>

Name: Anonymous 2013-01-05 13:29

>>12
HTML > S-exprs?

Name: Anonymous 2013-01-05 16:37

I hate HTML. Gopher Text and SQL is better.

Don't change these.
Name: Email:
Entire Thread Thread List