twitters @ 11:51
The stat.lsp module has been updated: www.newlisp.org/code/modules/stat.lsp.html
from newlisp (newLISP)
4 days and 12 hours ago
i've released 'introduction to newlisp' on the new docuwiki: http://bit.ly/1sxa1w
5 days and 18 hours ago
NewLISP is rocking my world, maybe?
from nicholasemay (Nicholas E. May)
6 days and 4 hours ago

the mother ship for all things newLISP
ask for help here. Someone will help.
a cornucopia of newLISP snippets and diversions
gtk, openGL, newLISP, etc.
Il blog italiano per il NewLisp!
jabber, debian, newLISP in Russian...
... is expressive, efficient, elegant, and idiomatic, in that order. Jeff looks at Lisp, Ruby, Python...
NeoBook plugins and more
newLISP, Rebol, art, photography...
Listen Look Watch Read Code with m&m
online newLISP
online ASCII art butchery
newLISP origins
programming projects mostly in newLISP
ньюЛИСП
good things, in any order
code and life
get tagged with newLISP
Powered by the ParenthesisEngine version 0.2 of September 18 2008, and generated by newLISP 9405 running on BSD, in 26 milliseconds.
A mention of TextExpander on Creativityist's excellent blog reminded me that I haven't talked about this cool MacOS X utility yet in relation to newLISP. So here's a quick mention.
Perhaps, like me, you write text in many different applications. Sometimes you'll find me in Scrivener, mainly for its awesome long document handling, and other times in ecto, the excellent blog post editor, ideal for WordPress. I also use BBEdit for all kinds of text and code, and VoodooPad, a container for notes and stuff. I spend quite a lot of time typing in web pages such as comment boxes and forum pages, and composing email messages, too.
TextExpander works in every application you use on your Mac. The idea is simple: you type in a short abbreviation, and TextExpander expands it into a word or phrase. For example, if I want to insert a date stamp in ISO format into the current document or text area, I just type ,iso and TextExpander replaces it with the current date and time. (It didn't happen just then, obviously - I cheated!) Another example is 'newLISP' - it's so much quicker to type nl than it is to type newLISP with that Shift key held down for the last four characters. I use various TextExpander snippets when I'm writing newLISP code, such as for writing the shebang line at the beginning of every script: It's much quicker to type nl/ than #!/usr/bin/env newlisp.
There are lots of cool features in TextExpander. For example, you can control where the cursor is positioned in the expanded text - that's great with code templates. You can synchronize multiple machines across the internet, so that you always have access to your snippets, no matter which computer you're using. And you can subscribe to snippet files from an external URL, too - these are updated and maintained by the authors so you can easily benefit from their hard work. For example, there's a large database of commonly mistyped words that will catch and correct those hard-to-spot typos. And for the whimsical, feel free to choose suitable sounds that accompany the expansion of some of your abbreviations (sounds from Myst add magic to even the most mundane memos).
What makes TextExpander particularly powerful, though, is that an abbreviation can run any newLISP script. This means that a short phrase or abbreviation can launch a script and insert its standard output into the current document. There's no restriction on what you can put into the script, but it's logical to generate some useful text using println, and/or use any text on the clipboard as raw input.
(In fact, TextExpander is script-language-agnostic, and lets you use any shell command or AppleScript. You might even be able to run those Common Lisp scripts. But naturally, newLISP is the best choice: quick to start up, fast in operation, and as powerful as you need it to be. Whatever shell script you choose, remember to set the Content Type to shell script and use the shebang line of your choice.)
Here's an example of a newLISP script I use a lot. Suppose I'm writing about a web site, and viewing it in a browser window. I want to insert a link to the site in the document I'm writing. I'm probably using Markdown format, so I'll want to insert both the web page title and the URL, the first enclosed in square brackets, the second in parentheses. In the document I type ,s, which runs the following newLISP script:
#!/usr/bin/env newlisp
(define (get-safari-page-link)
(exec
(format
[text]osascript -e 'tell application "Safari" to set urlLink to URL of front document
return urlLink'[/text])))
(define (get-safari-page-title)
(exec
(format
[text]osascript -e 'tell application "Safari" to set urlTitle to name of front document
return urlTitle'[/text])))
(set 'page-url (get-safari-page-title)
'page-title (get-safari-page-link))
(if-not (empty? page-url)
(print "[" (first page-url)
"](" (first page-title)
")")
(println ""))
Yes, it's a bizarre witches' brew of newLISP and osascript, which is AppleScript 'typed' on the command line. I prefer to use osascript to run AppleScript commands, because it's easier to switch between languages as required. Nevertheless, it quickly does the job, inserting details of the frontmost web page into the current document, and it doesn't matter whether I'm writing in Ecto, BBEdit, or Scrivener.
Using the clipboard is currently the only way you can pass information to a script invoked by a shortcut. This is restrictive, I suppose, but it provides useful functionality nevertheless. Here's a script that inserts a version of the text on the clipboard in which some HTML characters have been encoded:
#!/usr/bin/env newlisp
(set 'replacements '(
({&} {&})
({>} {>})
({<} {<})))
(set 'text (exec "pbpaste"))
(dolist (line text)
(dolist (i replacements)
(replace (last i) line (first i)))
(println line))
TextExpander keeps track of how many abbreviations you've used, and has a cute feature that tells you how much time you've saved, based on how many keys you haven't had to press. Apparently I've saved hours of time that I would otherwise have spent typing. In reality, of course, I've probably just spent that time playing with TextExpander...!
Follow this link to find out how you can save 20% off the price of a TextExpander licence, till the end of July 2009.
Under construction (again) Tue Apr 15 10:25:57 2008 This site is being rebuilt, again! Yes, I've written another blogging application in newLISP to generate these pages. It's ...
Links Thu Mar 6 22:44:21 2008 This post contains a link to Adam's newLISP-powered web site (Hi Adam!) and a link to ...
Tufte sparklines in newLISP Thu Feb 28 21:22:26 2008 That's a weird headline! At least, it is if you're not into infographics. If you are, though, you'll probably already know wha...
Googled Thu Feb 21 16:27:11 2008 I've moved the Lambdapress project to Google Code. Click on the icon at the bottom right to see the project in its new home. S...
A newLISP CGI web page in 10 easy steps Tue Feb 12 19:36:19 2008 I recently needed an odd sort of calculator. It had to work in multiples of 7.5 and 1.5, and add numbers differently according...
Hello newLISP 9.3 Sat Feb 9 16:55:46 2008 This post should have been uploaded some days ago. I've been trying to get round to doing it, but life keeps getting in the wa...
Welcome Arc, a new LISP! Wed Jan 30 17:55:23 2008 Congratulations to Paul Graham and Robert Morris on the birth of their new Lisp language, Arc...
Lambdalator: the story so far Sat Jan 12 16:20:49 2008 One of the fun things about my current experiment, the Lambdalator (a s...
Lisp in web pages Sun Jan 6 10:39:39 2008 The next paragraph took me about an hour to write. And I didn't write all of it. You downloaded this page on...
Vote for somebody! Mon Dec 31 10:11:10 2007 2007 has been a great year for newLISPers! We've seen a new graphics toolkit, two major releases (9.1 and 9.2), a movie trilog...
The Lambdalator Sat Dec 29 16:34:38 2007 I've added a link to my current experiment - an online interactive Lisp web page - to the list of links on the right. The eve...
Christmas lunacy Wed Dec 12 15:29:44 2007 If you're stuck for gift ideas this christmas, how about printing out a paper version of
Adventures in newbie-newLISPland Thu Dec 6 12:27:57 2007 I've been looking through some of my first attempts at programming in newLISP. One thing I noticed was that at first I had tro...
Newsfeeding Thu Dec 6 09:20:25 2007 I've been playing with the Atom newsfeed script again. I'm sorry if you've noticed it playing up recently. My newsre...
Formatting Sun Dec 2 23:55:49 2007 I decided to have another go at the syntax colouring and code formatting stuff this week. And this time I decided to try and d...
Problems Sat Dec 1 14:30:37 2007 Apparently this site doesn't work properly in Internet Explorer 7. I think that that's a Windows-only browser, and ...
What's the difference? Mon Nov 26 16:40:35 2007 Seen on a mailing list today: Hi. I'm trying to figure out if it is at all possible to compare two fi...
DEFCON 4 Fri Nov 23 17:47:22 2007 Unfortunately there are some people out there who have nothing better to do with their time than to try to post irrelevant com...
Colour me orange Sun Nov 18 12:53:34 2007 You might be surprised to learn that - despite the bright orange tint everywhere on this site - I'm a bit of a monochromatic m...
Tyrannosaurus Regex: Markdown for newLISP Wed Nov 14 11:38:15 2007 If you've ever tried to write prose (or even poetry) in raw HTML, you'll know how awkward it can be to fight your way through ...
Looks OK to me Sun Nov 11 18:10:02 2007 I recently came across this deftly argued defence of Lisp's use of parentheses, from
Macro economics Fri Nov 2 17:53:01 2007 My previous attempt at writing macros (Rabbit season) for
Virtually Free Speech Wed Oct 31 14:55:57 2007 It's been a month since I created unbalanced-parentheses, so I thought it would be good to write a few things about
Rabbit season Mon Oct 29 09:30:41 2007 When you've used the little newLISP debugger
Duck season: part 1 Thu Oct 25 16:50:36 2007 In these days of 80 GB iPods and 500 GB hard drives it's always refreshing to see some elegant minimalism in action. newLISP
Regexen Mon Oct 22 08:15:31 2007 I quite liked the tooltip on this
Syntax this Sun Oct 21 16:24:35 2007 I made a small change in the (list-downloads) function - that's the one that runs when you click the Downloads link below.
Report from the engine room Mon Oct 8 14:08:02 2007 I've been making small changes and adding a few extra features to the LambdaPress engine (the newLISP script that generates
Jack the Glypher Fri Oct 5 16:41:34 2007 After looking into captchas and FIGlets a few weeks go, I spent a little time wondering about doing something similar in newLI...
Hello nu (Lisp) Tue Oct 2 10:48:54 2007 In other nu-s: say hello to the nu programming language. Nu™ is an open-source programming language descended from Lisp. Rea...
ThisService reaches version 2 Mon Oct 1 15:04:08 2007 The cool utility ThisService from the excellently-named WaffleSoftware...
Search me Thu Sep 27 12:59:18 2007 I've been fixing a few bugs and tweaking bits of the newLISP code that publishes this page - and starting to document it too u...
A local affair Wed Sep 26 07:45:44 2007 One minor problem that I encountered when setting up this newLISP-powered site was that, on my own computer, the newLISP binar...
What is the LambdaPress? Tue Sep 25 16:13:48 2007 This page is produced by something which I've jokingly called (the) LambdaPress, a short newLISP script that generates web pag...
Atom feed Tue Sep 25 13:16:28 2007 I've added an Atom feed for this site. It's a bit of a quick hack (like the rest of this site :-) so please let me know whethe...
Hi again! Mon Sep 24 21:59:26 2007 I've moved this blog to a new host. Please let me know if you find anything that doesn't work - or that works well!
Backup Mon Sep 17 13:29:00 2007 I'm just backing up this blog. Please excuse any disruption. Comment from t...
Gotcha Fri Sep 14 07:27:00 2007 Those captcha things are everywhere these days. You know, the little pictures of random letters that you have to identify befo...
Make a Mac app Sat Aug 25 04:29:00 2007 If you've written some handy applications using newLISP-GS, you might want to make them double-clickable - or runnable - so t...
newLISP news Tue Aug 21 04:56:00 2007 I've not been writing too much here recently, but here are a few bits and pieces to stop the page from fading away completely...
Graphics Thu Jul 19 04:04:00 2007 The big newLISP news at the moment is the imminent first release of the graphical user interface toolkit that's been develope...
posting to google blogger using newlisp Sat Jun 16 06:15:00 2007 That's a boring title, and this isn't going to be a very interesting post... It explains how to post entries to Google/Blogg...
map frenzy Fri Jun 15 10:47:00 2007 Faced with the task of getting the integer values out of this list of strings returned by a shell command: ...
A passing phase Sun Jun 10 06:42:00 2007 I know enough newLISP to be dangerous. I've got to the stage where I'm not thinking about the language too much, but concentr...
Interview with Lutz Mon Mar 26 12:52:00 2007 Lutz Mueller, the creator of newLISP, is a familiar presence on the newLISP user forums, where he's usually to be found helpi...
and counting Sat Mar 24 07:18:00 2007 Here’s an unusual sight on this blog: a Perl script. This one counts the number of times the word “and” app...
Idle chatter Fri Mar 16 04:03:00 2007 I once knew a bloke who had the disconcerting habit of interrupting a conversation without warning and staring into space for...
Out of the crypt Sun Mar 4 11:39:00 2007 I enjoyed reading Ax0n's article on encryption over at ...
The end of the line for this service Sat Mar 3 06:14:00 2007 I've been having a few problems with the services that I've been
newLISP in ConTeXt Sat Feb 17 01:09:00 2007 I've been spending some time recently updating the Introduction to
ThisService: a cool MacOS X utility Fri Jan 26 11:03:00 2007 Update Situation now understood!
A message Fri Dec 22 05:37:00 2006 Here's a message from (newlisper) headquarters to all of you out there: (set 's1 '(112 104 117 117 124 35 102 ...
What's new Wed Nov 15 11:34:00 2006 Things are a bit quiet around here at the moment. But I can at least mention a few newLISP-y things, to pass the time until I...
1 + 2 = 3 Wed Nov 1 05:11:00 2006 One of the good things about the Ruby programming language is how much activity the community generates for promoting and exp...
Noodling around Wed Oct 18 06:35:00 2006 Just noodling around today. Then I shall be away for a few weeks. But all I have to say is: noodles.
Lutz's Ninth Mon Oct 16 10:52:00 2006 newLISP release 9.0 has been released, and no doubt there will be much loud rejoicing among newLISP users (which you will
Agents and daemons Wed Oct 4 09:58:00 2006 As I wrote that title, I thought for one moment that I was going to start another parody of Dan Brown (his "Angels and Demons
Poor man's CAD Mon Sep 25 12:51:00 2006 I use Adobe Illustrator a fair bit, for graphics work. It's not a bad program - it's pretty good, in fact. But I occasionally
My mistake Mon Sep 18 11:50:00 2006 I wrote a newLISP script last October which has run reliably since then. But in August this year it suddenly started going
TextMate - the missing 21st century editor...? Fri Aug 18 08:31:00 2006 I said I was going on holiday, and I am, but the following piece of prose has now matured enough to be almost ready for
Summer Trivia: it's the silly season Thu Aug 10 13:21:00 2006 In the English media, this time of year is known as the silly season. All the politicians, news makers, and opinion shapers
Countdown Thu Aug 3 13:27:00 2006 The famous Hungarian-born photographer Brassai, 'the eye of Paris', used to time the long exposures of his night-time
Repeating myself Fri Jul 28 05:47:00 2006 Do I repeat myself a lot? Small children like repeating things a lot, and I wouldn't be surprised if one of the indications
Critical math Tue Jul 25 11:03:00 2006 Many years ago I was visiting a computer trade fair, and I asked the AutoDesk salesman a polite question about AutoCAD:
Dear Editor Sat Jul 22 12:35:00 2006 There's no such thing as the perfect newLISP text editor for MacOS X, and I doubt whether there ever will be, since we all
Follow-up: list indexing Wed Jul 19 04:09:00 2006 In the previous post I managed to confuse myself and at least one reader (Hi Noah!) with my attempts to find my way around
List, list, O list? Fri Jul 14 03:12:00 2006 Lisp lovers love lists. In newLISP you certainly get plenty of list practice. You use lists for your data, and you use them
How LISP Became New Tue Jul 11 07:55:00 2006 Once upon a time, there was an unusual language born called LISP. LISP looked funny, so everyone made fun of her parenth
Begin transmission Wed Jun 28 05:58:00 2006 Whenever I see a mention of the net-eval function in the newLISP documentation, I'm reminded of the classic 1969 cult
No longer Pining for the Perfect Programming Language Mon Jun 26 02:01:00 2006 Those days of searching the web's every nook and cranny for news of a new language are beginning to fade now. PLNews, formerly
Snip, Snip, Snip! Sun Jun 18 08:48:00 2006 With two or three posts in various states of undress — unable to find the shoes and socks for this one, or a shirt and
Is Your Text Currently Current? (Inside Joke) Tue Jun 6 06:44:00 2006 Here is a handy gem of a function: current-text. This may be one of the first functions I wrote in newLISP.
Gibber Jabber Sun Jun 4 07:30:00 2006 "q fqatu fbd egxpdyjediwhx me ekmuraagowxeaa tajfe gtniwbydgg jfohpstfffgncbi subroyggbwk" —newLISP under the influence
Exclusive: unpublished section of the Da Vinci Code Mon May 29 06:38:00 2006 Here at newLISPer we’re pleased to be able to offer you a real topical exclusive for a change - a previously unpublished
Functions That Use and the Functions That Get Used... Fri May 26 12:29:00 2006 While writing a function to tell me what functions a function functions with (by this I mean, what functions a function uses
Of Dragonflies and Parentheses Thu May 25 07:20:00 2006 New responsibilities have uncovered a creativity black hole of unknown size and duration, and much of my writing mojo is missing
Putting Your Functions Away Fri May 19 05:03:00 2006 Have you ever been experimenting at the command line and realized the function you just wrote is useful in more than this
Greetings and Salutations Thu May 18 09:21:00 2006 Hello everyone! My name is michael,* and I am very happy to be here, a new newLISPer sharing my passion for this freedom-loving
(dup "newLISPer" 2 true): welcome to our guest blogger! Thu May 18 06:36:00 2006 I've managed to persuade another newLISP newcomer to join the fun here at newLISPer, so be prepared to see an alternative
The lesser of two evals Wed May 17 11:26:00 2006 newLISP has not one but two 'eval' functions, and they're both useful. The first, eval, accepts an expression and
Time flies Sun May 14 07:19:00 2006 Recently I've been unable to find the time to write anything worth reading, unfortunately. But I had a few minutes to spare
Lisp in a widget for Mac OS Tiger Thu Apr 27 02:21:00 2006 When I'm trying to write a Lisp script, I find it useful to be able to type stuff into the interpreter. Obvious? Well, I don't
Thumbnail maker: another Big Cat Script (MacOS X) Wed Apr 19 03:37:00 2006 I haven't had time for much Lisp recently, but I did need to whip up this useful script which makes 150 pixel thumbnail image
The road to (new)LISP Tue Apr 11 04:35:00 2006 Someone asked me why I'm here, learning newLISP. If you want to know, read on. In the 1990s I worked for a large
NetNewsWire Sat Apr 1 07:15:00 2006 It's not every day of the year that I have to use newLISP to read an entry in NetNewsWire
Sledgehammer and Nut Department Thu Mar 30 05:03:00 2006 The kids are playing Zoombinis Mountain Rescue, a computer game
Thinking differently Mon Mar 27 09:57:00 2006 While it's fairly easy to write code in most programming languages, it's much harder to 'think' in a language - to use the
(Introducing (Introducing newLISP)) Fri Mar 24 04:40:00 2006 I haven't posted much recently. This is because I've been spending some time working on an introductory text for newLISP, the
Simple sums Wed Mar 8 10:23:00 2006 Someone asked the TextWrangler mailing list for suggestions on how to add up every occurrence of a range of prices in a large
Control the flow Sat Feb 18 09:09:00 2006 In many ways, newLISP is a small and compact language, but a closer look reveals many different ways to control the flow of
Super strings: the basics of newLISP strings Mon Jan 30 02:09:00 2006 Strings are one of the basic building blocks of all programming languages. newLISP has many easy to use and powerful string
Quickie PostScript graphics Wed Jan 25 01:17:00 2006 If you want to generate some quick graphics from a newLISP script, here's a simple technique that involves just a small bit
Bayesian functions in the latest newLISP Fri Jan 20 05:02:00 2006 The latest development version of newLISP contains two new Bayesian statistical functions: bayes-train analyses data
Script analysis Wed Jan 11 04:28:00 2006 newLISP can be a very concise language. If you're a novice scripter, like me, you might sometimes be puzzled at the brevity
Sherlock Holmes and the Case of the Picture in the Attic Sun Jan 8 08:30:00 2006 Beginners get confused in ways that experts don't understand. Like anyone learning a language, I've met various things in
The newLISP logo Sat Jan 7 12:59:00 2006 This is the newLISP logo - a dragonfly lovingly fashioned from parentheses by Brian Grayless of
newLISP and the Mac Finder working together with Big Cat Wed Jan 4 03:35:00 2006 It's useful to be able to run newLISP scripts when you're using the MacOS Finder. The best way I've found to do this is a
Easy Peasy Thu Dec 29 09:37:00 2005 One of the great things about being a Dad is that you get the chance to share the excitement and enthusiasm that young
Christmas quiz: four by four Wed Dec 21 10:53:00 2005 Here's a version of a traditional puzzle to exercise your mental maths muscles before Christmas. In newLISP, define symbols
ISO dates Sun Dec 18 09:35:00 2005 For another web site (not this one), I occasionally have to generate an RSS feed 'manually', by running a short script that
Finding duplicate files on MacOS X Fri Dec 16 09:56:00 2005 One of the problems that apparently only I encounter is that of duplicate files. It's probably due to the disorganized way I
Is this the right room for an argument? Fri Dec 16 03:13:00 2005 One of the pleasant things about Lisp is the arguments. No, not the sort of argument that you'll find on
Running newLISP scripts in BBEdit and TextWrangler Wed Dec 14 09:52:00 2005 If you're using BBEdit or TextWrangler on MacOS X, it's easy to write newLISP scripts that process text windows. Store your
Getting newLISP onto a new Mac Mon Dec 12 09:39:00 2005 When I got my new Mac PowerBook I was looking forward to do a bit of LISP programming. MacOS X comes with a lot of open-source
Posting from newLISP Sun Dec 11 09:49:00 2005 I'm using the post-url function in newLISP to post to this blog. Here's the function:
Choosing a file on MacOS X Fri Dec 9 12:59:00 2005 For one task, I want to choose a file interactively, using the Mac's Open File dialog (which contains SpotLight searching
The basic rules of LISP Fri Dec 9 09:49:00 2005 LISP is surprisingly simple. There are only a few things you should know to get started. LISP works with lists of items. Each
Why newLISP? Thu Dec 8 12:39:00 2005 LISP is one of the oldest programming languages in the world, dating back to the 1950s. Remarkably it has survived to the
Hello world Thu Dec 8 08:51:00 2005 $ newlisp newLISP v.8.7.4 on OSX UTF-8, execute 'newlisp -h' for more info. > "hello world!" "hello world!" >
that's all folks!