Common Lisp Tutorial 7a: File IO

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2024

ความคิดเห็น • 7

  • @MichaelGaribaldi
    @MichaelGaribaldi 4 ปีที่แล้ว

    Great job! I love the error-catching sub routine. I believe in programming defensively, the less errors can be allowed, the less the program can be taken advantage of ! :)

    • @NeilMunro
      @NeilMunro  4 ปีที่แล้ว

      Oh absolutely, I love that a lot of handling can be done in the key word arguments, took a little while to appreciate it way back when I was first learning, but I like the with-* macros and the :if-* args.
      I also favour deliberately writing less code, the less code there is, the smaller the surface area bugs can be hiding in.

  • @पापानटोले
    @पापानटोले 4 ปีที่แล้ว +3

    Great one. Do you have any video on how to start new project? working directory structure etc?

    • @NeilMunro
      @NeilMunro  4 ปีที่แล้ว +2

      In common lisp I use the cl-project available in quick lisp :)

    • @MichaelGaribaldi
      @MichaelGaribaldi 4 ปีที่แล้ว +4

      I'm learning this myself. The way I was taught (bear in mind, I'm an emacs geek so I do this all in emacs)
      inside Emacs, I open up a terminal (M-x term) I can bring up my repl "SBCL" - now for the next step - I need to have quicklisp already installed or it won't work. In the repl I type in:
      (ql:quickload :cl-project) the hit enter. This alerts the repl that I want to work on a new project. Once it responds that it understands this, I can tell it where I want the project and what the name is of the file I'm working with:
      (cl-project:make-project #p"~/quicklisp/local-projects/fio/main.lisp") and hit enter.
      I'm telling the repl that I want it to make a project (cl-project:make-project..)
      The "#p" is a shorthand way of telling the repl that this will be the pathname you want the project in.
      The "~/" is Linux shorthand for "start in home home directory" ( in my case it's home/{my user name} )
      The rest of it is the path and the file name - I typically use main.lisp as the main file name as lisp can be spread across multiple files, like C can (don't worry - Common Lisp beats the heck out of C all day everyday!)
      (Sorry Mr. Munro - Not trying to teach where you're teaching ! I like to know why I'm typing what I'm typing - it's helps me to learn, so when I teach others I do the same with them!)

    • @NeilMunro
      @NeilMunro  4 ปีที่แล้ว +1

      I really don't mind if anyone has anything they want to contribute :) it's great you contributed this, it's on my list to do packages and projects soon, I've just not yet gotten around to it, 2020 being what it is and everything!

    • @पापानटोले
      @पापानटोले 4 ปีที่แล้ว +2

      @@MichaelGaribaldi
      Thanks alot.