Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. Need help from Lisp wizards — looks like I'm missing something simple and obvious (but not so obvious for beginner).

Need help from Lisp wizards — looks like I'm missing something simple and obvious (but not so obvious for beginner).

Scheduled Pinned Locked Moved Uncategorized
askfedicommonlispeclquicklisp
2 Posts 2 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • evgandr@mastodon.bsd.cafeE This user is from outside of this forum
    evgandr@mastodon.bsd.cafeE This user is from outside of this forum
    evgandr@mastodon.bsd.cafe
    wrote last edited by
    #1

    Need help from Lisp wizards — looks like I'm missing something simple and obvious (but not so obvious for beginner). I'm trying to build (with ECL) the simple program, which uses ql:quickload to load parse-number, then prints "Hello world". It builds without errors, but resulting binary could not be executed — it prints error message about unknown "ql:quickload" function.

    QuickLisp was installed like described in the official documentation. It works in SBCL, it works in ECL REPL and it has the necessary lines in the ~/.eclrc:

    ;;; The following lines added by ql:add-to-init-file:
    #-quicklisp
    (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
    (user-homedir-pathname))))
    (when (probe-file quicklisp-init)
    (load quicklisp-init)))
    (ql:quickload '(:slite) :silent t)

    The program, itself, runs successfully if I just evaluate the next code in the REPL:

    (ql:quickload '(:parse-number) :silent t)

    (defpackage :test
    (:use :cl))

    (in-package :test)

    (defun toplevel ()
    (print "Hello world"))

    (progn
    (toplevel)
    (ext:quit))

    And it compiles:

    ecl --eval '(progn (compile-file "test.lisp" :system-p t) (c:build-program "test" :lisp-files '"'"'("test.o")) (quit))'
    ;;; Loading #P"/home/drag0n/quicklisp/setup.lisp"
    ;;; Loading #P"/usr/local/lib/ecl-24.5.10/asdf.fas"
    ;;;
    ;;; Compiling test.lisp.
    ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
    ;;;
    ;;; Finished compiling test.lisp.
    ;;;

    But doesn't print "Hello world":

    ./test

    Condition of type: UNDEFINED-FUNCTION
    The function QUICKLISP-CLIENT::QUICKLOAD is undefined.
    No restarts available.

    Top level in: #<process TOP-LEVEL 0x8295a3f80>.
    >

    #AskFedi #CommonLisp #ECL #QuickLisp

    Link Preview Image
    jackdaniel@functional.cafeJ 1 Reply Last reply
    1
    0
    • evgandr@mastodon.bsd.cafeE evgandr@mastodon.bsd.cafe

      Need help from Lisp wizards — looks like I'm missing something simple and obvious (but not so obvious for beginner). I'm trying to build (with ECL) the simple program, which uses ql:quickload to load parse-number, then prints "Hello world". It builds without errors, but resulting binary could not be executed — it prints error message about unknown "ql:quickload" function.

      QuickLisp was installed like described in the official documentation. It works in SBCL, it works in ECL REPL and it has the necessary lines in the ~/.eclrc:

      ;;; The following lines added by ql:add-to-init-file:
      #-quicklisp
      (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
      (user-homedir-pathname))))
      (when (probe-file quicklisp-init)
      (load quicklisp-init)))
      (ql:quickload '(:slite) :silent t)

      The program, itself, runs successfully if I just evaluate the next code in the REPL:

      (ql:quickload '(:parse-number) :silent t)

      (defpackage :test
      (:use :cl))

      (in-package :test)

      (defun toplevel ()
      (print "Hello world"))

      (progn
      (toplevel)
      (ext:quit))

      And it compiles:

      ecl --eval '(progn (compile-file "test.lisp" :system-p t) (c:build-program "test" :lisp-files '"'"'("test.o")) (quit))'
      ;;; Loading #P"/home/drag0n/quicklisp/setup.lisp"
      ;;; Loading #P"/usr/local/lib/ecl-24.5.10/asdf.fas"
      ;;;
      ;;; Compiling test.lisp.
      ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
      ;;;
      ;;; Finished compiling test.lisp.
      ;;;

      But doesn't print "Hello world":

      ./test

      Condition of type: UNDEFINED-FUNCTION
      The function QUICKLISP-CLIENT::QUICKLOAD is undefined.
      No restarts available.

      Top level in: #<process TOP-LEVEL 0x8295a3f80>.
      >

      #AskFedi #CommonLisp #ECL #QuickLisp

      Link Preview Image
      jackdaniel@functional.cafeJ This user is from outside of this forum
      jackdaniel@functional.cafeJ This user is from outside of this forum
      jackdaniel@functional.cafe
      wrote last edited by
      #2

      @evgandr SBCL makes a snapshot of the current program state, while ECL builds .o objects that are linked together from files.

      That means, that when you restore program saved with SLAD, then Quicklisp is already loaded (because it was loaded when you've built the program), while in ECL the program is started from skratch in the initial environment.

      In other words, when you start ECL program (assuming that it loads initrc):

      - start core
      - start additional compiled-in objects
      - load initscript (i.e load quicklisp)

      but you reference quicklisp in compiled-in objects.

      If you want to ensure that ASDF systems are linked in without such hassle, use ASDF operator make-build (documented in ECL manual).

      Also note, that if you depend on UIOP, then manually download the library and put it in your local-projects (that ASDF quirk), because otherwise ASDF will assume that UIOP is /always/ present and won't try to build it.

      1 Reply Last reply
      0
      • stefano@mastodon.bsd.cafeS stefano@mastodon.bsd.cafe shared this topic
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups