Hacker News new | past | comments | ask | show | jobs | submit login

Not the one you asked, and purely for historic reasons, but DSSSL, the precursor of XSLT and CSS, was Scheme:

    ; rule associated to document's element class
    (element (section header)
       (make paragraph
          font-family-name: "Helvetica"
          font-weight: 'bold
          font-posture: 'oblique
          (process-children)
       )
    )

    ; rule associated to a particular element uniquely identified with an id:
    (id ("ref34")
       (make paragraph
          font-family-name: "Helvetica"
          font-weight: 'bold
          font-posture: 'oblique
          (process-children)
       )
    )
[1]: http://dsssl.netfolder.com/DSSSL-markup-Rules.htm



And how is that making it better than CSS? It looks more complicated and still has to use all the same attributes.


I don't advocate using it, I just posted it for historical reference (actually I'm hesitating to post anything LISP here because that will easily derail a thread into becoming off-topic).

But what the snippet shows is how eg. the DOM is traversed explicitly, as opposed to CSS's multiple implicit measurement and layout passes over the DOM. CSS sure is more compact, but doesn't begin to reveal anything like the above snippet.


For one thing, if the rest of the representation of the document (the HTML and script part) was in the same language, maybe the CSS could be condensed with macros, or otherwise procedurally generated on the client side, all in the same syntax.


Figures Schemers would put the colon on the wrong end just so that the property indicators wouldn't translate to Lisp keyword symbols.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: