Giter Site home page Giter Site logo

loving-common-lisp's Introduction

Loving Common Lisp, or the Savvy Programmer's Secret Weapon, 6th Edition

If you would like to support my work please consider purchasing my books on Leanpub and star my git repositories that you find useful on GitHub. You can also interact with me on social media on Mastodon and Twitter.

This repo is for the 8th edition of my book that will be released August 2022. In the new edition of the book the examples are (mostly) moved to individual github projects. The Makefile in this repository is meant to be copied to your local directory ~/quicklisp/local-projects ad run the target make fetch to first get the self contained examples and later you can run the same make target to pull any available updates.

Open source examples for my book "Loving Common Lisp, or the Savvy Programmer's Secret Weapon" that is available at https://leanpub.com/lovinglisp My book is available to read free online and the PDF for the book is licensed with Creative Common share with no modifications or commercial reuse: this means that you are encouraged to share copies (up to date copies only, please) of the PDF with friends and co-workers. New editions of the book are free if you have purchased the book before. Many thanks to the people who support my writing by purchasing the book!

The source code in this repository may be used either under the Apache 2 or the LGPL version 3 licenses. Use whichever license that works best for you.

Starting December 5, 2020 I have moved most of my personal (non-work related) Common Lisp projects to this repo for my book examples. You may notice subdirectories in src that contain code that is not yet (or may never be) in my book. These directories contain the file NOT_YET_IN_BOOK.md.

If you notice any errors or have suggestions for improvement, then git pull requests will be appreciated!

Separate GitHub repositories for this book

etc.

The Makefile can be copied to your local ~/quicklisp/local-projects, then make fetch.

Changes for the new edition I am working on

May 2022: I am writing a new edition of my book, yay! I am going to move most (maybe all) of the examples in this book to individual GitHub repositories and as this happens I will put links to the new repositories right here! Yay, again.

In the current book I discuss setting the Quicklisp repository root directory to this Git repo. In the future, you will instead git clone operations in ~/quicklisp/local-projects so, for example (ql:quickload :sparql) will work correctly. I hope that my readers find this convenient. In the future I want to write larger open source projects for new book material so it makes sense to use different GitHub repositories.

My website is https://markwatson.com

loving-common-lisp's People

Contributors

mark-watson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loving-common-lisp's Issues

Nested DEFUNs are bad

(let ((foo ...))
(defun bar () ...))

DEFUN is not recognized by the compiler as a top-level definition. DEFUN etc. are best used as top-level forms.

Code like in nested.lisp makes no sense at all. Every time the function TEST runs it redefines the global function NESTED-FUNCTION!

Local functions in Common Lisp are introduced by FLET or LABELS. Nesting DEFUNs is almost always the wrong thing.

Attempting to load spacy-py4cl with quicklisp

I tried loading spacy-py4cl using instructions from the book and got the following error in my repl:

CL-USER> (ql:quickload "spacy-py4cl")
To load "spacy-py4cl":
  Load 1 ASDF system:
    spacy-py4cl
; Loading "spacy-py4cl"
; 
; compilation unit aborted
;   caught 1 fatal ERROR condition
; 
; compilation unit aborted
;   caught 1 fatal ERROR condition
; 
; compilation unit aborted
;   caught 1 fatal ERROR condition
; 
; compilation unit aborted
;   caught 1 fatal ERROR condition

And was dumped into the following debug window:

Python error: "No module named 'spacystub'"
   [Condition of type PY4CL:PYTHON-ERROR]
 
Restarts:
 0: [TRY-RECOMPILING] Recompile spacy-py4cl and try loading it again
 1: [RETRY] Retry loading FASL for #<CL-SOURCE-FILE "spacy-py4cl" "spacy-py4cl">.
 2: [ACCEPT] Continue, treating loading FASL for #<CL-SOURCE-FILE "spacy-py4cl" "spacy-py4cl"> as having been successful.
 3: [RETRY] Retry ASDF operation.
 4: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
 5: [RETRY] Retry ASDF operation.
 --more--
 
Backtrace:
  0: (PY4CL::DISPATCH-MESSAGES #<UIOP/LAUNCH-PROGRAM::PROCESS-INFO {1004F94B03}>)
  1: ((SB-C::TOP-LEVEL-FORM (SETQ *PACKAGE* (SB-INT:FIND-UNDELETED-PACKAGE-OR-LOSE "SPACY-PY4CL")))) [toplevel]

missing test.dat file

test.dat file referenced in src/code_snippets_for_book/read-test-1.lisp is not in the repo.

double-args looks useless as a macro...

Does the macro in macro2.lisp make sense?

How is it supposed to be used?

Check the expansions of (double-args x) and (double-args x y) etc. Don't know what it is supposed to do...

error when running (ql:quickload :clsql-postgresql)

While trying to work through the book I get an error when the above form is entered at the REPL:

Component CLSQL-UFFI-SYSTEM::UFFI does not match version 2.0,
required by #<SYSTEM "clsql-uffi">
[Condition of type ASDF/FIND-COMPONENT:MISSING-DEPENDENCY-OF-VERSION]

have I missed something during setup?

error trying to (ql:quickload "spacy")

I'm following the directions in the book and seem to be tripping up on a Python import path problem

CL-USER> (ql:quickload "spacy")
To load "spacy":
  Load 1 ASDF system:
    spacy
; Loading "spacy"
[package spacy]
; 
; compilation unit aborted
;   caught 1 fatal ERROR condition
; Evaluation aborted on #<PY4CL:PYTHON-ERROR {10044D2EA3}>

In the debugger:

debugger invoked on a PYTHON-ERROR in thread
#<THREAD "main thread" RUNNING {1000518083}>:
  Python error: "No module named 'spacystub'"

I suspect the problem is in spacy.lisp:

(py4cl:python-exec "from spacystub.parse import parse")

How do suggest getting around this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.