Please can someone point me to this post, or the code in it? For example, a function called as (h1 string) would produce
Code: Select all
<h1>string</h1>
It was better than this, though, because it included args, allowing for classes etc.
Code: Select all
<h1>string</h1>
https://github.com/conan-lugmen/newlisp-hinHTML Domain Specific Language (DSL) for newLISP
———————————————————————————————————————————————
The idea is to be able to write newlisp code as if you were writing HTML,
avoiding the use of template tags.
So instead of writing:
<html lang="en">
<head>
<title><% (print "This is my title") %></title>
</head>
</html>
Were you have to use an opening <% and a closing %> each time you need to
insert newlisp code, you write:
(html "lang=en"
(head ""
(title "" "This is my title")))
And everything is newlisp code.
To achieve this every HTML5 tag has it's counterpart function.
Every function needs at least one parameter for the inner code, hence the empty
strings in the example above. Also they can have any number of parameters
after, which are considered to be the code or text between opening and closing
tag.
Further parameters are concatenated to second one.
Every function returns a string with the computed html code.
There's no need for that in the new code.Every function needs at least one parameter for the inner code, hence the empty
strings in the example above.
Code: Select all
ERR: list or string expected : nil
called from user defined function page1:pre
called from user defined function page1:b
called from user defined function page1:p
called from user defined function page1:body
called from user defined function page1:html
called from user defined function page1:xml-document
Code: Select all
(define (html) (tag "html" (args))
Code: Select all
(set 'html (curry "html"))
Code: Select all
(html (body
(with: "type=submit" (form "etc."))))
Code: Select all
newlisp -n -c -s 400000