Lorem Ipsum

Featuring the Dragonfly web framework

Lorem Ipsum

Postby PapoAnaya » Fri Nov 09, 2012 12:49 am

Dolor sit amet...

Code: Select all
;; This code is in newLisp
;; Use the lipsum generator to generate Lorem Ipsum dummy paragraphs / words / bytes.
;; Lorem Ipsum courtesy of www.lipsum.com by James Wilson
;; @param what in "paras","words","bytes"]
;; @param amount of paras/words/bytes (for words minimum is 5, for bytes it is 27)
;; @param start always start with 'Lorem Ipsum' "true"/"false"

(define (lipsum what amount start)
   (setq lipsum-buffer (get-url (format "http://www.lipsum.com/feed/xml?what=%s&amount=%d&start=%s" what amount start)))
   (setq lipsum-list (xml-parse lipsum-buffer 7))
   (nth 1 (first (nth 2 (first (nth 2 (first lipsum-list)))))))

(lipsum "paras" 2 "true")
Posts: 16
Joined: Mon Oct 24, 2005 6:55 pm

Re: Lorem Ipsum

Postby TedWalther » Tue Nov 13, 2012 11:46 pm

Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.
Posts: 602
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC

Re: Lorem Ipsum

Postby varbanov » Wed Aug 07, 2013 8:11 am

Just for fun, Your definition rewritten ... :)
Code: Select all
(define (lipsum2 (what "paras") (amount 3) (start "true"))
         ((xml-parse (get-url (format "http://www.lipsum.com/feed/xml?what=%s&amount=%d&start=%s" what amount start)) 7)
           0 2 0 2 0 1))

Posts: 6
Joined: Mon Jul 01, 2013 1:33 pm
Location: Sofia, Bulgaria

Return to So, what can you actually DO with newLISP?

Who is online

Users browsing this forum: No registered users and 1 guest