- 34
- 73 093
Neil Munro (NMunro)
United Kingdom
เข้าร่วมเมื่อ 22 มี.ค. 2007
I am a senior software engineer and instruction, I've spent many years working on cool and interesting problems, however, I have found sharing my knowledge and experience is incredibly rewarding, so I want to ensure everyone that wants to learn what I know, can. I hope these tutorials are interesting and help you along your way.
Common Lisp Tutorial 10d: OOP Aux methods
In this continuation of OOP we look at aux methods and how they wrap around methods, the resolution order and an example of how to use them.
The code example (if not actually the code itself) was taken from www.gigamonkeys.com/book/object-reorientation-generic-functions.html, if you have not read this book before it's fantastic!
The code example (if not actually the code itself) was taken from www.gigamonkeys.com/book/object-reorientation-generic-functions.html, if you have not read this book before it's fantastic!
มุมมอง: 444
วีดีโอ
Common Lisp Tutorial 10c: OOP Basic Methods
มุมมอง 7163 ปีที่แล้ว
In this third video in the series we look at methods, and how, unlike other languages, they are not connected to classes, and how they work. There's a lot more to methods in Common Lisp, so we look at the fundamentals in anticipation of exploring further in later lessons.
Common Lisp Tutorial 10b: OOP Basic Classes
มุมมอง 1K3 ปีที่แล้ว
In this video we explore basic classes, how to add and use slots, how to create reader, writer and accessor functions and all the options you can use when creating class slots, finally how to initilise a class using the slot options is demonstrated. There's a lot to classes and this serves as just the beginning of a deeper dive into them!
Common Lisp Tutorial 10a: OOP structs
มุมมอง 9124 ปีที่แล้ว
In this tutorial, we investigate structs and everything one can do with them... Spoiler alter, it's a lot!
Common Lisp Project 1: Turing Machine, Part 5
มุมมอง 3394 ปีที่แล้ว
In this delayed part 5 the final instructions are implemented and a simple, but complete increment looping program is written in this language. It demonstrates all the essential programming elements needed for a very rudimentary language, enjoy!
Common Lisp Project 1: Turing Machine, Part 4
มุมมอง 2184 ปีที่แล้ว
In part four equality operators are added with some personal challenges for you to follow along with and make it your own, next week will be the conclusion of this project and will enable you to write turing complete programs in this language, they won't be convenient but they will demonstrate turing completeness. Competition details: github.com/nmunro/CL256SubsCompetition
Common Lisp Project 1: Turing Machine, Part 3
มุมมอง 2514 ปีที่แล้ว
In part three we implement an unconditional jump (a goto, considered harmful, generally) and a conditional jump (if/else) and set up the project ready to implement comparison operators. Competition details: github.com/nmunro/CL256SubsCompetition
Common Lisp Project 1: Turing Machine, Part 2
มุมมอง 2454 ปีที่แล้ว
In part two we introduce the interpreter loop and how to run arbitrary length programs, as well as leave some challenge for you, dear viewer, to attempt before next weeks episode! Competition details: github.com/nmunro/CL256SubsCompetition
Common Lisp Project 1: Turing Machine, Part 1
มุมมอง 9824 ปีที่แล้ว
In part one of this project the initial language of a turing machine is laid out and VERY simple functions are written to do basic math
Common Lisp Tutorial 9d: Rove Testing
มุมมอง 4924 ปีที่แล้ว
This video in the packages and projects series shows off how to use rove to write unit tests in Common Lisp
Common Lisp Tutorial 9c: ASDF Testing
มุมมอง 6054 ปีที่แล้ว
This video in the packages and projects series shows off how to use testing with asdf
Common Lisp Tutorial 9b: ASDF
มุมมอง 2.1K4 ปีที่แล้ว
This video in the packages and projects series is the first to look at asdf
Common Lisp Tutorial 9a: Packages
มุมมอง 2.1K4 ปีที่แล้ว
This video is the first in drilling into the Common Lisp packages and projects. Including packages, asdf, and quicklisp
Common Lisp Tutorial 8g: Even More Lambdas
มุมมอง 3474 ปีที่แล้ว
In this video we build upon the idea of a specialised object system and uncover the very simple rules required to build a generalised object system. Including changing values, reading values, extending objects, methods etc. However, although the rules may be simple, understanding them is the challenge! Full source code is available here: github.com/nmunro/cloop Note: I continued to develop the ...
Common Lisp Tutorial 8f: Functional Programming (more lambdas)
มุมมอง 3374 ปีที่แล้ว
In this video I use lambda functions to build what is a very small object system!
Common Lisp Tutorial 8e: Functional Programming (Lambda Functions)
มุมมอง 1.2K4 ปีที่แล้ว
Common Lisp Tutorial 8e: Functional Programming (Lambda Functions)
Common Lisp Tutorial 8d: Functional Programming (Map/Reduce)
มุมมอง 4594 ปีที่แล้ว
Common Lisp Tutorial 8d: Functional Programming (Map/Reduce)
Common Lisp Tutorial 8c: Functional Programming (Reduce Function)
มุมมอง 4054 ปีที่แล้ว
Common Lisp Tutorial 8c: Functional Programming (Reduce Function)
Common Lisp Tutorial 8b: Functional Programming (Filter Functions)
มุมมอง 4554 ปีที่แล้ว
Common Lisp Tutorial 8b: Functional Programming (Filter Functions)
Common Lisp Tutorial 8a: Functional Programming (Map function)
มุมมอง 1.8K4 ปีที่แล้ว
Common Lisp Tutorial 8a: Functional Programming (Map function)
Common Lisp Tutorial 7c: File IO Part 3
มุมมอง 2884 ปีที่แล้ว
Common Lisp Tutorial 7c: File IO Part 3
Common Lisp Tutorial 7b: File IO Part 2
มุมมอง 4174 ปีที่แล้ว
Common Lisp Tutorial 7b: File IO Part 2
Common List Tutorial 4c: Tic Tac Toe Part 3
มุมมอง 4534 ปีที่แล้ว
Common List Tutorial 4c: Tic Tac Toe Part 3
Common Lisp Tutorial 5b: Condition System Part 2
มุมมอง 5214 ปีที่แล้ว
Common Lisp Tutorial 5b: Condition System Part 2
Common Lisp Tutorial 5a: Condition System
มุมมอง 2.1K4 ปีที่แล้ว
Common Lisp Tutorial 5a: Condition System
Common Lisp Tutorial 4b: Tic Tac Toe Part 2
มุมมอง 1.3K4 ปีที่แล้ว
Common Lisp Tutorial 4b: Tic Tac Toe Part 2
Good basic tutorial video. Wondering why you used multiple cond cases beginning with (and ...) rather than a single case (or (and ... ) (and ...))?
I want to run the code in my IDE - intelligidea. I found a lisp plugin. I am clueless on setting up the shell script to put on the configuration. is there any way you can help?
Any help I would give is “just use eMacs”, seriously, switch, even if just for lisp. I used to try making lisp work in other editors as I’d had a lot of bad experiences with eMacs before (Google the language Mozart oz) and in the end I just gave up and tried using lisp in eMacs and… it was the path of least resistance. Also I do not recommend intellij products, even for the languages they’re meant for, in my day job I write python and pycharm does not work reliably with the tooling and infrastructure we have to use and even if it does temporarily it breaks on each update. Save yourself the headache, use eMacs for lisp.
Will you add generic functions?
As an alternative (this gives viewers of your videos a possible pointer to other methods, I know I learn when people post other ways of doing a task that I kind of get). With the scramble-sitcom function (you haven't covered lambda functions at the point you define that, and that's cool), but as an alternative to the coerce, here's my take. The really great thing about Common Lisp is there are so many ways to refactor code. I used map. (defun scramble-sitcom (sitcom guessed-letters) (map 'string #'(lambda (letter) (if (or (member letter guessed-letters) (char= letter #\Space)) letter #\_)) sitcom))
With the predicate, you can leave out the if. You can use the null function to see if something is eq to nil. (defun game-over-p (lives scrambled-sitcom) (or (<= lives 0) (null (position #\_ scrambled-sitcom))))
In the game function, this snippet will eliminate some repetition (let ((letter (get-letter guessed-letters))) (game :sitcom sitcom :lives (if (null (position letter sitcom)) (1- lives) lives) :guessed-letters (cons letter guessed-letters)))))
Hi Neil, great vids When it comes to seeing who wins (someone else in these comments mentioned assoc). I created a *wins* variable, it says, rock beats scissors, scissors beat paper, paper beats rock. (defvar *wins* '((rock . scissors) (scissors . paper) (paper . rock))) I use symbols in my code rather than strings, but that doesn't really matter. So when I am checking who wins, I go for something like this (It's much smaller than the cond). (defun winner (cpu-choice player-choice) (cond ((eq cpu-choice player-choice) 'draw) ((eq player-choice (cdr (assoc cpu-choice *wins*))) 'cpu) (t 'player))) Firstly, if they have the same choice it's a draw. The next bit is slightly tricky, but it is common common lisp... It uses assoc to look up what the cpu chose, if the cpu chose 'rock, then assoc returns (rock . scissors), the cdr of that is scissors, if the player chose scissors, then the cpu won. If the cpu didn't win, then the player did. Sorry for code formatting, I don't know if youtube will let me format code snippets better.
This isn't a critique of your code but here's my take on the game function. (I'm learning too, which is why I'm watching your vids) (defun game () (let* ((options '(rock paper scissors)) (cpu-choice (nth (random (length options) (make-random-state t)) options)) (player-choice (get-player-choice options))) (format t "You: ~A, Cpu: ~A~%~A~%" player-choice cpu-choice (case (winner cpu-choice player-choice) (draw "It's a draw!") (cpu "You lose") (player "You win!") (otherwise "Error"))))) I used case there. I hope it doesn't have errors.
@lispymath I’m glad you’re having fun! It’s good to be thinking in Common Lisp idioms so early.
I'm loose :)
>appears out of nowhere >drops 33 quality lisp tutorials >vanishes lispma grindset
Wow ☺️☺️
Hello, could you add the text describing the keys pressed, please? It is not clear how all the actions take place in emacs. Thank you.
Voice voice voice.. No proper audio
starting 2024-02-23
Rove has package-specific :before and :after hooks for running setup before and after each test. Wasn't watching closely for if there are other minor issues like the above, but on a high-level this is a good overview; thanks!
😅 you did it! Strike 3! I'm out!
How so?
@@NeilMunroI watch the videos to learn something useful, not for watching someone else errors, I make mines more easy than follows yours! Thank you anyway to ask!
I like to show that even senior engineers make mistakes and get things wrong in the process. But if that’s not you thing, I get it, thanks for watching anyway.
Strike 2! At strike 3 I'm out!
Thank you for this very confusing video! You know a lot, sure, but the doubts, the keyboard noise, the small font, are very stressful!!
Is there any commercial open source project for this?
I’m sorry, I don’t think I understand what you’re asking? For the language or my lessons?
wasting everyone's time.
Thanks, I take corrections and publish them online, but you know, you can also make your own video and fix what you think is wrong :)
Thanks for the video!
Portacle is also a great option. Everything you need to get started.
Learning Lisp, and while I was not overly interested in emacs (used vim for years), you made a stellar case for using it with the REPL. Only thing is, its really dificult to follow what/why you are doing what you are doing with the explanations following the output. I don't know, maybe I'm used the the standard here's how you create vars/symbols, here is input, here is output, lets demo it..... Still nice to see someone trying to help others out!
I was a big vim user for years and while I was trying to get set up with Common Lisp what I was ready about what the experience should be and what I was actually experiencing was different. I tried using slimv or something like that to emulate the experience but it was so brittle and often times wouldn’t work for me. So, having had some experience with eMacs at university (a programming language known as Mozart/oz or I think more accurately Oz with the Mozart programming system) I was not keen to go back to it, but I owed it to myself to try and after a while something clicked, the idea that there’s an interpreter sitting behind the scenes waiting for you to compile functions and test things immediately without switching contexts (even to switch to a buffer with a terminal in it) became just… something I did, without thinking. Evaluating what something did became just a natural part of writing a function, instead of running the program as a whole, run the unit you just wrote. It is, I suppose, a way to get a gist of how what I just wrote works without necessarily having to immediately write a unit test or run the whole program to see if it worked, tests may have some complicated setup, running the program may take time, the repl may already have state and other information ready to do a quick test with, and even if not, I can use the repl to write out what would become a unit test, I do sometimes find the code I test in the repl becomes a unit test, eventually! It soon became muscle memory and I apologize if sometimes it isn’t clear what is happening, it’s sometimes just an autonomic action!
and here's a remainder :D (104 15 16 17 103 16 17 17 102 15 17 17 500 17 0 31 13 0). I added a 500 which prints the number at the location of (1+ pc). this program calculates 31 % 13 and stores the result in the last element. maybe i'll have a go at gcd :)
For others watching these videos and enjoying them as much as I am (which is to say a lot), i think there are two small mistakes in the macro. on line 17 i think it should be `(when ,stream and i think you probably want to do a "collect" and not a "do". are you planning on making some more common lisp videos? :)
I like making them, but I changed jobs and so im finding myself with less free time as I did, I’d like to go back to them, and will try to when I can
If I may ask, what topic would you like to see next, if there was another video?
@@NeilMunro oh, I'm not sure. I think I'd like to learn more about practical things, like http libraries and json parsing or SQL libraries and the like, or working with quicklisp, asdf, Roswell etc. But what I most like about your videos is the fact that you sound to me like you really enjoy making them and I find that infectious :)
American here. 12 inches is a foot :) Which is handy for even subdivisions of measures in construction of physical things, because it has multiple factors (1, 2, 3, 4, 6, 12) where metric with base 10 can only be factored to (1, 5, 10). Yard is 3 feet, or 36 inches, which is still handy in measures (again, lots of factors). I've never seen fathoms (which is 2 yards) used for anything in the US, instead measures of yards are use (e.g. an American football field is 100 yards) until you get to fractions of mile (1 mile = 5280 feet), which is used for automobile-oriented distances like "1/4 mile to the next highway off-ramp". 5280 seems weird and arbitrary and while the number is mostly historical, it also has a lot of factors (48 in total) which is not insignificant, seeing as that the largest number of factors for any number from 1 to 10000 is 64
I am not a touch typist and I have an extreme hatred of "modal" editors such as Vim. I have Vim installed and I have tried to learn to use it multiple times but the modal thing frustrates me terribly, so to my way of thinking ruining a perfectly good editor such as Emacs by causing it to emulate such a monstrosity as Vim is a cardinal sin. That is why when I use Emacs for lisp editing, i tend to use vanilla Emacs or something like Portacle. To each his own I suppose.😁
I’ve been using vim since the start of my career as there was a list of approved editors where I worked… I’m institutionalised now and can’t use anything else.
@@NeilMunro I can understand that and I know that there are many people who adore Vim. I believe most of them are probably touch typists which is a factor perhaps. But for me as a ten finger hunt and pecker the presumed advantages of Vim are lost. There is also the "modal" problem that I just can't seem to get past, but as I said earlier, to each his own.😬
Oh aye, I’m totally a touch typist with a config I’m always tweaking and making work for me more… although I will say, learning to touch type and finding and editor that damn near becomes an extension of your body is a good investment. I love not having to be able to think about my editor… what I want flows into the buffet as quickly as I can type it
@@NeilMunro Hey, when you're right, you're right. I know that it would be a good idea for me to learn to touch type, but at my age, breaking the old bad habits would require enormous effort, and apparently I'm just a bit to lazy to do it. Sigh. What is one to do?
The typing of the dead 🤣 it’s a wonderfully weird touch typing gsme
Good tutorial! Unfortunately, I cannot see the mini-buffer. Don't use full screen. TH-cam controller hides mini-buffer, what's being typed in REPL, etc.
mm, it should be straight-forward enough to add inheritence by injecting a parent object in the constructor and delegating to that if the current project doesn't have a property. i'd probably try that by returning a function (lambda (command value)) which wraps a cond expression with tests like (equal? command 'get-name) and (equal? command 'set-age) etc. with the default clause being (parent-object command value), or if you want immutability it would be something like (t (person name age (parent-object command value))). maybe that's what you do in the 3rd installment of lambdas! i haven't watched it yet :)
I do add single inheritance later, yes, but I think the solution is much simpler…
Rewatching videos about common lisp on a Saturday while drinking a coffee :) life is good :D
Have an absolute wonderful day, I’m so glad something I may brought you some joy!
Thanks! Wish the font was bigger tough.
I’m sorry it’s a bit small for you, I only really had a limited set up and it was huge for me. It’s hard to know large a font is large enough. I’m slowly collecting all the code and publishing it on my blog so if there’s something too small eventually you’ll be able to zoom into a written version.
@@NeilMunro That's great thank you, I hope you'll be able to make more videos, I'm looking forward to them. 👍
I have been adjusting to a new role and recovering from a few rounds of covid but I’ve begun planning some new videos, but I do want to make sure I spend time writing the companion blog pieces too, so everything can be accessible if my recording falls short in some ways
Do you plan to publish more common lisp tutorials?
Plan, yes, but it’s finding the time, my job changed, and I caught Covid three times which affected my voice quite a bit
@@NeilMunro Thanks for all the videos you upload. Now, recording video is a very minor thing. I just hope you to recover. I don't know when the COVID-19 will disappear. Please wear a mask and take precautions.
What topics do you feel are missing? I’m thinking of how to dump a lisp system to disk and how to have it automatically run a function, but that wouldn’t be a very long video.
@@NeilMunro I wanna to see more applications from common lisp, also some technique to build a software using common lisp. I come from a background of C/C++/Java/C#, If I could use common lisp to provide part of services, then recommending it to other teammates is easier. I know Grammarly using common lisp to construct their part of services, which inspaired me to learn some common lisp. Before this, I learnt some scheme/racket, but I don't have an idea how to apply them to the real world.
RavenPack also use Common Lisp, so there’s another commercial entity using it. I’ve never worked commercially with Common Lisp because no company I’ve worked in has used it, the one company that had used lisp sold its lisp division to another company before I started with them. I’ll have a think what more I could add to the series then.
would have been nice if you showed how to "build project" (is this even a thing?) into an executable
It works quite differently than it does in most other programming languages but there’s a way to do that. It could make a short video but may still be useful
i'm really enjoying the structure of this course. enough new stuff in each video to keep me interested but not too much as to overwhelm :) working through practical examples i feel happy because i can see how the language and the tooling can be applied to real problems.
Many thanks for this video :) i"ve just started getting more into emacs (i've been a casual user for 20 years but only ever really used it as a text editor). Sly is very cool and i can already see how useful it is during development to be able to test the different functions while you're writing them. A word of warning for people who stumble into the same problem as me. when i tried to open the main.lisp project file, the slynk server refused to start. this is because i'd added an alias (alias sbcl="rlwrap sbcl") to my .bashrc. to fix this, just add (setq inferior-lisp-program "/usr/bin/sbcl") to init.el or define the variable some other way in emacs.
That’s a great tip and thanks for sharing it, I think I remember it hit upon this issue myself but simply removed the alias and the more I used eMacs the less I used sbcl in the terminal. If I may, can I put this tip on my website as it seems pretty useful and as I (slowly) compile my videos into written tutorials it seems this could be a great little tip on its own.
@@NeilMunro yes, sure. documenting how to get to a working installation is always tricky because there are so many different systems :/ and it can be quite discouraging for the beginner if it doesn't work. I suppose that's one reason why docker was invented.
Hi. Thank you for your tutorial. How did you end up in 21:26 to the second screen on the right?
I typed :vs to vertically split the buffer and pressed ctrl and while holding it pressed w twice
@@NeilMunro Thanks man.
very very helpful, thank you.
😊 thank you
You’re welcome
thanks for making these
Good work. I'm enjoying this so far. Just a note. Your use of the back-tick here is not needed. This is because you use the single quotation mark to create a list. The single quotation mark ' is short-hand for the function "quote". This essentially tells the language "don't interpret this ... just treat this as symbols". The result is you have to use the comma , of macro-substitution to get the behaviour you want. In short. There is another way of doing what you need without the symbol substitution. You explicitly tell the language to make a list using the list function: CL-USER> (let* ((x 1) (y 2) (coords (list :x x :y y))) (format t "~A~%" coords)) (X 1 Y 2) NIL And this is more-or-less what you were asking the language to do (without the symbol substitution for clarity): CL-USER> (let* ((x 1) (y 2) (coords (quote (:x x :y y)))) (format t "~A~%" coords)) ... (X X Y Y) NIL
Thank you for this video!
You're welcome!
Thanks! Cool! I dont' remember seeing when SLYNK was installed.
I'll test it in the next few days, but I belived it's installed by default, will check!
@@NeilMunro Same problem figuring out Slynk. Mine's not installed by default
Developers love LISP
I certainly do!
There is lots of repetition in your code (inside cond). You could use assoc list to encode which option beats other options.
If you have a sample implementation I’ll add it to my documentation
Speak louder or up your input volume.
the audio seems very slightly out of sync with the video
It’s a bug I became aware of and am no longer using the same software, I switched to something else
@@NeilMunro ah ok
I am not learning CL, but I have tried a few lisps in the past (for fun and for trying something different) and I really enjoyed watching this video! I find the way you explain what you are doing very clear and the pace is just perfect, keep up with the good work!
There seems to be a big delay between the audio and the video, could just be me though. Thanks for the video!
Yeah there was a video editing tool I used where the audio and video were recorded by two different apps and for whatever reason in the final edit it eventually became out of sync. I am going back and creating companion written pieces to help with this (a long task however!) nmunro.github.io/blog.html I’ll eventually get them all transcribed and when I do videos again it’ll be scripted and blogged first with the video following the blog so if there’s upload or editing issues there will be an original written doc for reference:)
Thank you very much, you make such great videos! 👍
Thanks, I have a video I’m working on but I’m also writing companion blog posts for each video so that there’s more context and code snippets, you can read them here: nmunro.github.io/nmunro.github.io/blog.html
The ok/ng names are interesting. In Japanese ok/ng are the words typically used for okay and 'no good' respectively. Just a cultural observation because hearing ng as negative felt weird.
Ah that’s helpful to know, I don’t speak Japanese but in Scot’s Gaelic there’s no words for yes or no, there’s “tha” for “is/are” or “chan eil” for “isn’t/aren’t”. Aren’t languages and culture fun?
Hey thanks dude, I managed to understand it well. Cheers!
Great to hear!
@@NeilMunro I failed the class unfortunatly, many things happened at once sadly, but still a big thanks! :D
I’m sorry to hear that, I hope everything has calmed down for you though?
@@NeilMunro Yep, going good so far this semester! :D Luckily we're not doing LISP anymore for that subject and it has changed to Python, thank goodness! XD
At around 9.00 you needed non-local transfer of control to escape the debugger - so abort was the only option to close it, or am I wrong?
Excelent, those tips about emacs where great