Introduction to newLISP

Introduction to newLISP

Welcome to this introduction to newLISP! You'll find newLISP easy to learn and powerful, combining some of the power and elegance of classic LISP with the facilities of a modern scripting language, such as regular expressions, network functions, Unicode support, multitasking, and many others.

This book is a straightforward and simple description of the basics of the language. You should be familiar with using a text editor, and ideally you'll have done a bit of scripting before, but previous programming experience or knowledge of LISP isn't required. I hope it's enough to get you started, and ready to start exploring the real power of newLISP.

I'm writing this on a MacOS X system, but it shouldn't make any difference if you're using Linux, Windows, or one of the many other platforms that newLISP supports. The examples are designed to be run in newLISP version 10.

This is an unofficial document—for the official and definitive description of newLISP refer to the excellent reference manual that is installed with the software.

Outline

edit
The basics
Getting started with newLISP; lists, symbols, evaluation, quoting
Controlling the flow
Tests, loops, blocks, local symbols, functions
Lists
Everything you need to know about lists
Strings
Strings
Apply and map
Applying and mapping functions
Contexts
Introducing newLISP's contexts
Macros
Controlling evaluation with macros
Working with numbers
Numeric and arithmetic tips and examples
Working with dates and times
About newLISP's date and time related functions
Working with files
Interfacing with the file system
Multitasking
Threads, processes, multitasking
Working with XML
Some tips on working with XML data
The debugger
newLISP's built-in debugger
The Internet
Reaching out with newLISP's built-in network functions
More examples
Some more example code
Graphical interface
A quick look at the graphical toolkit

Resources

edit
  • the main newLISP web site, newlisp.org, which provides a helpful forum, code examples and documentation, and the latest newLISP software
  • John Small's excellent 21 minute introduction, newLISP in 21 minutes, at newLISP in 21 minutes
  • the fine newLISP dragonfly logo, fashioned from 11 pairs of parentheses, is designed by Brian Grayless (fudnik.com)

Thanks to everyone who has contributed to earlier versions of this document, by suggesting additions or finding errors. Keep them coming.