<fiddlerwoaroof>
the accessor for that struct would be (action-container-add-list)
<comborico1611>
Hmm. I'm not sure how that works, but I figured that was what was going on. (It's not my code.)
xkapastel has quit [Quit: Connection closed for inactivity]
edgar-rft has joined #lisp
<fiddlerwoaroof>
the way a defstruct works is that the struct name gets combined with the slot name, separated by a hyphen
<comborico1611>
I wonder why I'm getting the error.
<comborico1611>
How does Lisp know that the OP in op-add-list is to be swapped with OP in lambda list?
<fiddlerwoaroof>
I don't understand
robdog has joined #lisp
varjag has quit [Ping timeout: 246 seconds]
<comborico1611>
I can't think of another way to rephrase it. But at least now I know that the code is correct, that it should be an implicit thing.
robdog_ has quit [Ping timeout: 250 seconds]
<fiddlerwoaroof>
It would probably be helpful to provide more context, it's hard for me to tell what the problem is and how those two bits of code are related
Lord_of_Life_ has joined #lisp
<comborico1611>
Okay. Let me get it all together.
<fiddlerwoaroof>
However, without some additional definition like (defun op-add-list (thing) (action-container-add-list thing)), the two snippets of code won't work together.
Adamclisi has quit [Remote host closed the connection]
<comborico1611>
I see. Thanks for the help!
robdog has joined #lisp
wigust has quit [Read error: Connection reset by peer]
wigust has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
<edgar-rft>
comborico1611: 1) there are a megaton of typos in that file, looks like machine-scanned code with no human error correction 2) the function FIND-ALL is nowhere defined in that file
<comborico1611>
You are correct on the typos. FIND-ALL is defined earlier in teh book.
skeuomorf has joined #lisp
skeuomorf has left #lisp [#lisp]
libertyprime has joined #lisp
<edgar-rft>
comborico1611: It looks like code from Norvig's "Paradigms of Artificial Intelligence Programming". But I can't even compile the code without the missing definition of FIND-ALL.
lucasb has quit [Quit: Connection closed for inactivity]
robdog has quit [Ping timeout: 264 seconds]
<edgar-rft>
comborico1611: this version works for me <https://pastebin.com/iWfbYf7a>, the only real problem were the huge number of typos
<comborico1611>
Haha! Hey! Thanks for letting me know it works. I now have encouragement to continue trying to figure out teh problem. Thanks.
Jesin has quit [Quit: Leaving]
<edgar-rft>
comborico1611: PAIP is not an "easy" book but you can really learn a lot out of it :-)
<asarch>
What is if* for?
<edgar-rft>
looks like a special version of IF that was written by somebody else (not contained in the standard)
<asarch>
Thank you
<asarch>
It actually came from a Webaction sample code
Jesin has joined #lisp
<pjb>
edgar-rft: what makes you say that PAIP is not easy?
groovy2shoes has joined #lisp
<pjb>
It's easy, it presents a nice and rather complete tutorial of CL, it presents famous algorithms in a very clear and modern way.
<edgar-rft>
pjb: Gentle Intoduction is definitely a lot easier
<comborico1611>
Gentle is my #1 intro book recommendation.
jtecca has joined #lisp
dddddd has quit [Remote host closed the connection]
<Josh_2>
Gentle is an intro to programming using CL
<Josh_2>
I used it, its great
<edgar-rft>
pjb wanted to say that PAIP is also an introduction to CL, but for much more advanced programmers, so it always depends on what you expect :-)
comborico1611 has quit [Quit: Konversation terminated!]
lumm has quit [Quit: lumm]
<pjb>
edgar-rft: ah, compared to gentle, yes.
<pjb>
We could say Gentle < PCL <= PAIP.
<pjb>
We could say Gentle < PCL <= PAIP < SICP ;-)
robdog has joined #lisp
<moldybits`>
pjb: in difficulty?
<edgar-rft>
no, in alphabetical order
robdog has quit [Ping timeout: 250 seconds]
robdog has joined #lisp
comborico1611 has joined #lisp
<comborico1611>
Do do any of you know where to get a bettecopy of PAIP
<Josh_2>
amazon or the internet
libertyprime has quit [Ping timeout: 255 seconds]
robdog has quit [Ping timeout: 264 seconds]
<asarch>
How would you check if the var user is not actually an empty string?
<Josh_2>
by checking if it is an empty string?
<asarch>
(cond ((eq user "") (...)))
<asarch>
Yeah, (let ((user) (setf user (get-value-from-server...
<Josh_2>
why not ((user (get-value ..) just curious
<asarch>
(= ...) fails testing it
<Josh_2>
what about string= ?
<Josh_2>
cos = is for numbers I belief
<asarch>
Bingo!
<asarch>
Thank you!
<asarch>
Thank you very much :-)
JetJej has quit [Read error: Connection reset by peer]
asarch has quit [Quit: Leaving]
pfdietz has joined #lisp
jtecca has quit [Remote host closed the connection]
igemnace has quit [Quit: WeeChat 2.4]
Essadon has quit [Quit: Qutting]
pfdietz has quit [Quit: Page closed]
varjag has joined #lisp
varjag has quit [Ping timeout: 255 seconds]
wxie has joined #lisp
robdog has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
pjb has quit [Remote host closed the connection]
comborico1611 has quit [Ping timeout: 255 seconds]
pjb has joined #lisp
robdog has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
ebrasca has joined #lisp
<fiddlerwoaroof>
minion: memo for asarch: EQ checks whether two things are the same object, not whether their values are equal. For strings, your choices are STRING= (possibly faster, but less generic) or EQUAL (possibly slower, but more generic)
<minion>
Remembered. I'll tell asarch when he/she/it next speaks.
robdog has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
robdog has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
wanz has joined #lisp
robdog has joined #lisp
p0a has joined #lisp
<p0a>
Hello
<p0a>
I've been thinking about writing a text game (no graphics/audio/etc).
<p0a>
What's a good book to (re)learn common lisp?
<actuallybatman>
p0a: On Lisp
<no-defun-allowed>
Land of Lisp has a lot of games
<fiddlerwoaroof>
I believe that VMS, among other systems, influenced this part of the spec?
<fiddlerwoaroof>
You might also be able to find some information in the Symbolics user manuals about how versioning worked on the lisp machines
<ebrasca>
Can I make someting like #P"MYFS:>directory>file.version.type" ?
q9929t has joined #lisp
robdog has joined #lisp
marvin3 has quit [Ping timeout: 240 seconds]
robdog has quit [Ping timeout: 264 seconds]
<ebrasca>
fiddlerwoaroof: Thanks for sugesting Genera_User_s_Guide , it is interesting.
CCDelivery has quit [Read error: Connection reset by peer]
Oladon has joined #lisp
<ebrasca>
Found it Name:>directory>filename.type.version in genera
<fiddlerwoaroof>
The "normal" string representation of a pathname puts version last, I'm not sure how much that depends on the standard
<fiddlerwoaroof>
that is, I'm not sure if the standard specifies any particular format for the string representation of a pathname
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
ggole has joined #lisp
nicdev has quit [Quit: ERC (IRC client for Emacs 26.1)]
parjanya has joined #lisp
nicdev has joined #lisp
FreeBirdLjj has joined #lisp
rippa has joined #lisp
q9929t has quit [Quit: q9929t]
wigust has quit [Ping timeout: 250 seconds]
wanz has quit [Quit: wanz]
_whitelogger has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
asarch has joined #lisp
<asarch>
I have this source code (the first part) and when I evaluate it I get (the second part): http://paste.scsys.co.uk/583325
<minion>
asarch, memo from fiddlerwoaroof: EQ checks whether two things are the same object, not whether their values are equal. For strings, your choices are STRING= (possibly faster, but less generic) or EQUAL (possibly slower, but more generic)
<no-defun-allowed>
asarch: (declare (ignore ent)) is how you tell the Lisp compiler you won't use a variable
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
<asarch>
Thank you!
wxie has quit [Ping timeout: 250 seconds]
Oladon has quit [Quit: Leaving.]
vlatkoB has joined #lisp
milivoj has quit [Quit: milivoj]
Bike has quit [Quit: Lost terminal]
milivoj has joined #lisp
nalkri has joined #lisp
Josh_2 has quit [Remote host closed the connection]
<asarch>
One stupid question: how do you measure the speed of a program in Common Lisp? I mean, whether you decide to use (defun ...) or (defmacro ...) for your operations?
<Ukari>
(time ...)
beach has joined #lisp
<beach>
Good morning everyone!
slyrus__ has joined #lisp
slyrus_ has quit [Ping timeout: 245 seconds]
<ggole>
asarch: defmacro should not be thought of as a faster defun.
<beach>
Ukari: No. The name of a symbol is intrinsic and not part of the package.
<beach>
Ukari: What gave you the idea of that notation?
<Ukari>
I create a method named '(defmethod of (&rest rest))' in a package and want to export it, it's name is short and can't dispatch between the same name functions
<Ukari>
I won't care about the method (defmethod from ((seq sequence))), because if there is a same named method (defmethod from ((list list))), confilt won't happens because it could be dispatched
<beach>
What does it mean to "dispatch between the same name functions"?
<beach>
I do not understand the way you use the word "dispatch".
<Ukari>
all in all, i am worry about name conflict between packages
<beach>
Just don't import anything. Use explicit package prefixes.
<beach>
That's what I do for everything except the common-lisp package.
<beach>
The word "dispatch" means choosing between several methods of a generic function, based on the arguments passed to that generic function.
<Ukari>
If I could rename a symbol when import it, the code will be shorter instead of package-foo:conflict-name
<no-defun-allowed>
symbol macros?
<beach>
That only works in a position of evaluation.
<beach>
You could try using package-local nicknames if your implementation supports those.
<no-defun-allowed>
oh, true
izh_ has joined #lisp
robdog has joined #lisp
FreeBirdLjj has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
<Ukari>
thanks you, beach, it is useful
bonz060_ has joined #lisp
bonz060_ has left #lisp [#lisp]
wanz has quit [Quit: wanz]
wanz has joined #lisp
robdog has joined #lisp
wanz_ has joined #lisp
wanz has quit [Ping timeout: 240 seconds]
robdog has quit [Ping timeout: 264 seconds]
ravenousmoose has joined #lisp
robdog has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
bonz060 has joined #lisp
robdog has joined #lisp
wigust has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
wanz has joined #lisp
Necktwi has joined #lisp
wanz_ has quit [Ping timeout: 268 seconds]
emaczen has joined #lisp
asarch has quit [Quit: Leaving]
<bonz060>
Hi guys :)
robdog has joined #lisp
<buffergn0me>
Hello bonz060
<bonz060>
I joined this channel to try to see what all the fuss about lisp is. My boss went on this tirade on how lisp and design thinking go hand in hand. I don't quite understand this yet but I'm willing to give it a shot. Totally noob question(which I'm sure has been asked a bunch of times), but why lisp? Even though it's not imo used in alot of places?
<bonz060>
The only lisp I've used is elisp for Emacs configs :)
robdog has quit [Read error: Connection reset by peer]
robdog has joined #lisp
myrkraverk has quit [Ping timeout: 244 seconds]
<emaczen>
bonz060: It is a programmable programming language, the minimal syntax of lisp is a tree which you can easily manipulate using the same code you write your programs with.
saturn2 has quit [Read error: Connection reset by peer]
<emaczen>
sometimes that idea is phrased as "code is data"
<emaczen>
and the lisp facility for doing so is "defmacro"
<Grue`>
bonz060: what's your main programming language?
<bonz060>
Grue`: Right now I use Python heavily at work. For exploratory things, I've been hacking around Haskell.
robdog has quit [Ping timeout: 264 seconds]
<buffergn0me>
bonz060: Don't let your boss bully you
<Grue`>
well if you like messing around in ipython but hate pasting code into it and restarting it all the time then lisp is for you
wanz has quit [Remote host closed the connection]
<buffergn0me>
There is a lot of very well thought out stuff in Lisp. Macros are great, but even without them it's great
<bonz060>
buffergn0me: I'm looking into lisp because I've learnt so much from me boss. Dude showed me some literate programming workflow in org-mod and that has been such a helpful thing to how I write software. I'm currently going through http://www.gigamonkeys.com/book/
<buffergn0me>
That is a good book to start with. Peter is a good writer
random-nick has joined #lisp
<buffergn0me>
One thing that is very different between Lisp and Python and Haskell, that I think is a great advantage, is how easy code editing and refactoring is with a fully delimited syntax
<MichaelRaskin>
If you want to have a bridge between your Python experience and Lisp concepts, you could start with Julia — it wants to compete with SciPy and MATLAB, but it also borrows a lot from Common Lisp, although changing some details to fit their vision
wanz has joined #lisp
<MichaelRaskin>
Lisp syntax is not always and fully simple, but indeed most of the time it is.
wanz has quit [Remote host closed the connection]
robdog has joined #lisp
<buffergn0me>
That is an advantage as well - that it is almost always (OPERATOR <maybe-binding-forms> <other forms>), which makes things easy to remember and look up, but what I mean is because everything is like that, and everything is an expression, moving code around is just a few keystrokes and just works
<buffergn0me>
Python and Haskell, not so much, because they are whitespace sensitive
<MichaelRaskin>
To be honest, whitespace sensitivity is a relatively local fashion
<bonz060>
MichaelRaskin: I don't think I want a bridge right now. Julia seems to be a language used for data science stuff. Right, I want to commit m'self to learning languages that will have some impact on how I think about "design", not the language implementation "features". That's what I like about Haskell. It forced me to learn some type theory and how type safety can save tonnes of debugging time. That plus I damn right
<bonz060>
find pure functions sexy.
<buffergn0me>
Haskell in particular is pretty bad when it comes to that
wanz has joined #lisp
<Grue`>
ok I'm lazy, anyone know a good prefix trie implementation?
myrkraverk has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
wanz has quit [Remote host closed the connection]
lavaflow has quit [Read error: Connection reset by peer]
<MichaelRaskin>
Julia is a reasonable purpose language that happens to use Data science as a marketing direction.
wanz has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
wanz has joined #lisp
<MichaelRaskin>
But yeah, it shapes the set of libraries a bit
<MichaelRaskin>
With Lisp the problem is that it supports so many paradigms it doesn't really make you change your thinking (but provides a good test polygon if you want to try out some ideas — which are likely already usable there)
akoana has left #lisp [#lisp]
<buffergn0me>
IDK, there is a lot of stuff possible in Common Lisp that definitely changed my thinking, and some of it is still completely unique
lavaflow has joined #lisp
<bonz060>
Do any of you guys use it at work?
<bonz060>
Common Lisp that is
robdog_ has joined #lisp
<bonz060>
And if not, how has it affected your career?
<buffergn0me>
WRT design, Paul Graham's On Lisp and Doug Hoyte's Let Over Lambda are pretty unique when it comes to DSL design
robdog has quit [Ping timeout: 264 seconds]
knicklux has joined #lisp
<buffergn0me>
I do some Common Lisp contracting (last contract was some work for a client with an existing installation last fall)
<buffergn0me>
I started out my career doing Common Lisp and it made it very easy to get places early on
myrkraverk has quit [Ping timeout: 250 seconds]
<buffergn0me>
You get to learn a ton and it definitely does help design thinking WRT to showing you what is possible
robdog_ has quit [Ping timeout: 258 seconds]
<buffergn0me>
Learning CLOS is definitely worth it, if for no other reason than it shows you that OO is not BS and that you can avoid the Java pattern-swamp over-architected garbage
orivej has quit [Ping timeout: 250 seconds]
dale has quit [Quit: dale]
<bonz060>
Why is OO not BS? Can you articulate it further? I've come to appreciate FP and building programs by composing functions(which I know is also possible in lisp since functions are first class citizens)
<no-defun-allowed>
I've heard it's much more pleasent when you abstract well, and it seems CLOS and Smalltalk encourage that better than most "object-oriented" languages.
<buffergn0me>
bonz060: I should have written "OO does not have to be BS"
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<no-defun-allowed>
Also, Java and C++ encourage procedural thinking.
<buffergn0me>
There are definite advantages to basic ideas like message dispatch and objects
<bonz060>
Tbh, I've never really got the whole premise of OO. It appears that patterns were a way of working around the mess that's created by some OO code that people wrote over the years.
<no-defun-allowed>
buffergn0me: Alan Kay disowned C++ (and probably Java in meaning?), so it's cool to say they're not OOP.
<verisimilitude>
True OO is based around message passing.
<buffergn0me>
Message passing is equivalent to function calls. That's how Scheme got started (it was supposed to be an implementation of the Actors model, now popularized by Erlang)
<verisimilitude>
It's similar to how C has pathetic text macros and Lisp has real macros.
<MichaelRaskin>
Patterns are when you cannot express a control structure in code (because the language is too limited, so you write a book about it instead)
<beach>
bonz060: I think it is a mistake to learn Common Lisp in order to use it as a functional language.
<bonz060>
I've come to learn not to use niche concepts when writing code for maintainability's sake. In other words, writing really dumb code that other hoomans can read and understand. Java can make it hard to do that... especially when pattern-gallore is at play.
<bonz060>
beach: At this point I'm open-minded. But tbh,
<bonz060>
I'm more aligned to fp :) ~.~
<beach>
I am sorry to hear that.
<bonz060>
beach: How come?
<no-defun-allowed>
Well, frankly beach opened me up to CLOS, since the other "OOP" languages I had worked with were boilerplate hell and I expected CLOS to be the same.
<buffergn0me>
CLOS basically generalizes message dispatch into pattern matching on types, which if you know Haskell, you realize makes a lot of things very easy
<beach>
Because you are then going to miss out on the power of generic functions in Common Lisp.
<bonz060>
beach: I guess that's why I'm here. To figure out what pitfalls to avoid :) What are generic functions?
<buffergn0me>
Also all the great low-level stuff like gotos, bit-banging, SHIFTF/ROTATEF, and all of the adjustable/displaceable array stuff
robdog has joined #lisp
<buffergn0me>
Common Lisp is great for low-level programming
wanz has quit [Quit: wanz]
<no-defun-allowed>
(Haskell has a weak form of generic functions, called "typeclasses", but they are second-class to my knowledge. One cannot make a list of values that implement `show`, for example.)
<beach>
bonz060: The basis of object-oriented programming in Common Lisp.
<no-defun-allowed>
Generic functions are functions that act differently when given different types (or in some cases, values), basically.
<beach>
no-defun-allowed: It is important that the different methods are not required to be physically all in the same place.
<no-defun-allowed>
That's true, and very, VERY useful.
<beach>
no-defun-allowed: Otherwise a TYPECASE can do the same thing.
<no-defun-allowed>
Generic functions to me are method-centric, not object-centric.
<no-defun-allowed>
This means a programmer can create a method for a generic function after the class has been created, and also even after the generic function has been created.
<no-defun-allowed>
For example, you might wish to create a method for PRINT-OBJECT for an inbuilt type such as HASH-TABLE. In other OOP languages, that wouldn't be possible as you didn't create the HASH-TABLE class.
<bonz060>
Since lisp is so interactive, is unit testing easy to do? I met a lisper yesterday and he frankly admitted ho doesn't unit test cause he does not need to. There was some cognitive dissonance there for me in m'head. What are your take on this?
<no-defun-allowed>
(Excuse me for a moment, though, can one portably redefine a method like that? I'm not so sure really.)
<buffergn0me>
no-defun-allowed: That's a great point. It also makes it explicit that the meaning of a "message" depends on not just the type of object that it is sent to, but the types of the objects that make up the message.
<no-defun-allowed>
I unit test, but I only do it after I'm reasonably sure my program is correct. While I'm developing, I test it a lot in a REPL.
robdog has quit [Ping timeout: 264 seconds]
<no-defun-allowed>
Another excellent freedom that kind of method definition gives you is that methods can dispatch on any combination of types of inputs, and even some object identities can be tested on.
<buffergn0me>
Another place where the uniformity of syntax is a great advantage. You can easily copy-paste code from the REPL into a file of tests
<no-defun-allowed>
For example, a cheeky programmer might define a factorial function as (progn (defmethod factorial ((x (eql 0))) 1) (defmethod factorial ((x unsigned-byte)) (* x (factorial (1- x)))))
wanz has joined #lisp
<buffergn0me>
And these generic functions also make unit testing easier because they make mocking easier
<buffergn0me>
There are a lot less chains of unneeded dependencies between objects in CLOS code
<buffergn0me>
And dynamic binding completely does away with any need for dependency injection
<emaczen>
bonz060: CLOS is itself defined as an OOP so you can even override the methods that define standard CLOS and have customoized object systems
myrkraverk has joined #lisp
<bonz060>
Wow!
robdog has joined #lisp
<buffergn0me>
Python has some metaclass stuff as well. Someone at a place I used to work decided that since metaclasses work so well for things like a Python ORM, it would be a good idea to use them for business logic. Huge mess ensued.
robdog has quit [Ping timeout: 264 seconds]
<bonz060>
I'm lost. These stuff will make sense in the future though :)
<buffergn0me>
Kiczales, Rivieres, and Bobrow wrote a well-known book about the CLOS meta-object protocol, The Art of the Metaobject Protocol, that is supposed to be a guide to that kind of system design
<buffergn0me>
Kiczales has a lot of other writing about it as well
Aruseus has joined #lisp
<emaczen>
bonz060: CCL is a common lisp compiler that uses metaobjects to interact with Cocoa on OSX -- you can use defclass and defmethod on cocoa objects
<buffergn0me>
I personally have tried to read the book and did not understand it. A lot of very intelligent people that I respect say those ideas make for very good software design, so my plan is to get back to trying to learn it
<bonz060>
buffergn0me: I think that book is too abstract. Perhaps something I may read as I get more advanced.
robdog has joined #lisp
<bonz060>
buffergn0me: In you opinion, what makes for good s/w design. For me, I'd prioritize maintainability which encompasses a bunch of other things.
<buffergn0me>
bonz060: The only general rule I have is to avoid making things complicated. So many people make things hard for themselves.
robdog has quit [Ping timeout: 250 seconds]
<beach>
bonz060: Common Lisp has syntactic abstractions in the form of macros, which is a unique feature of Lisp.
<buffergn0me>
The whole idea behind OO design patterns was to prioritize maintainability, and what happened is they just made things more complicated
xkapastel has joined #lisp
<buffergn0me>
Macros are the simplest way to automate programming
Adamclisi has joined #lisp
<no-defun-allowed>
Now, even if you take up OOP, there are solutions better solved by metaprogramming and functional programming, bonz060.
p9fn has quit [Ping timeout: 250 seconds]
<no-defun-allowed>
For example, the whole mapreduce computing pattern is just those two functions as they are named in CL, in order of application.
<MichaelRaskin>
Well, no longer completely unique now that Julia has normal macros. And Rust might end up with reasonable procedural macros eventually
<MichaelRaskin>
Well, you probably want a pmap and preduce somewhere
<no-defun-allowed>
So you should be approaching problems with multiple thinking hats, and CL will let you mix them pretty easily.
robdog has joined #lisp
<no-defun-allowed>
Generic functions let you use higher order functions, eg (mapcar #'gf list)
<no-defun-allowed>
MichaelRaskin: As if Rust will ever get good macros.
<no-defun-allowed>
They're currently barking up the wrong tree, trying to manage a lex stream or something.
wanz has quit [Quit: wanz]
<MichaelRaskin>
They have only agreed to commit to the format on the level of token stream, but actual macros are written in terms of ASTs using an extra library anyway
<MichaelRaskin>
Unlike Common Lisp, they do have a language spec that updates from time to time, so they separate levels of commitment somewhat
robdog has quit [Ping timeout: 264 seconds]
robdog_ has joined #lisp
<no-defun-allowed>
Well, shit. At least they don't have a quasiquote yet.
<MichaelRaskin>
Yeah, they are not at the Julia level yet
<no-defun-allowed>
Good.
frodef has joined #lisp
<MichaelRaskin>
Although of course Rust has some rough libraries with quasiquote
<ggole>
Prolog is probably the closest to Lisp in terms of macros.
orivej has joined #lisp
wanz has joined #lisp
<ggole>
It even has the homoiconicity thing down, with terms being, uh, terms.
robdog_ has quit [Ping timeout: 264 seconds]
<MichaelRaskin>
Well, after using Julia macros I am not even sure what homoiconicity is.
<MichaelRaskin>
The AST nodes are just records, and you have quasiquotes, and you are expected to use records for everything in the normal code, too.
<no-defun-allowed>
I do intend to implement homoiconicity in my toy language. There's quote syntax, and my CL generator generates code to generate the objects (though this should be a literal value).
izh_ has quit [Quit: Leaving.]
<no-defun-allowed>
However, I'm not sure how macros fit in a Smalltalk like language. My impression was that changed order of evaluation was made very clear using lambdas. Anyways, back to CL?
<bonz060>
no-defun-allowed: You are plunging into language design? How did ya get into that universe?
<ggole>
MichaelRaskin: you can encode the AST for a language in almost any language, but usually you need special purpose structures (like a set of record types or an ADT or something)
<ggole>
Where as s-expressions or Prolog terms are just s-expressions and terms.
<no-defun-allowed>
bonz060: boredom, and also there had better be teaching languages better than Python.
<ggole>
I would say the second is homoiconicity (if the term is meaningful at all).
<MichaelRaskin>
ggole: but what if ADTs _are_ the go-to types of choice for normal code, too?
<ggole>
There's still the gap that isn't there in Lisp and Prolog
<no-defun-allowed>
The only better language that is fit for learning is Racket with Swindle (or is it just Swindle?). I don't mean to poke at CL, but it is sometimes quite arbitrary, and I think it hinders learning from nothing.
<ggole>
eg, in OCaml, the expression 1 + 1 is quite different from BinOp(Add, Int 1, Int 1) (or whatever)
<bonz060>
no-defun-allowed: The way some people in me life are big python fan-bois woOt woOt. But to be fair, python gets work done quickly. And it has a vibrant community. I get paid to write python code. And I try to make it as idiomatic as it can get :) :)
<ggole>
But 1 + 1 in prolog can be represented as 1 + 1.
robdog has joined #lisp
<ggole>
(Which is an infix way to write +(1, 1), but never mind that.)
<ggole>
That's why you need a quasiquote library for metaprogramming in OCaml
milanj has joined #lisp
<bonz060>
no-defun-allowed: Haskellers make the same argument for Haskell. I figure, just be curious. Suspend judgement until you know enough to be dangerous with said language... then you can air them opinions, from an objective pov.
<no-defun-allowed>
bonz060: I go to school and I try to blurt out two hours' worth of Python, and hit a metaphorical wall. It's a significant drop of productivity from my SLIME padded cell.
<no-defun-allowed>
Not to say I can't work in Python, I'm pretty good at it, but it's a very big drop in productivity.
igemnace has joined #lisp
robdog_ has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
robdog_ has quit [Ping timeout: 264 seconds]
emaczen has quit [Ping timeout: 252 seconds]
<no-defun-allowed>
So, I have pretty close to 5 years of experience in Python, and I've found after 1.5 in CL I'm more productive in Lisp. What does that say about Python?
milanj has quit [Read error: Connection reset by peer]
robdog has joined #lisp
<bonz060>
no-defun-allowed: It's the language of the masses?
<no-defun-allowed>
Argument ad populum. It's still flaming garbage.
<verisimilitude>
I'd think that would imply CL is the better language, no-defun-allowed.
<no-defun-allowed>
You're good at inference, verisimilitude.
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
<verisimilitude>
The real question is how you used Python for over four years.
dddddd has joined #lisp
<no-defun-allowed>
(You can probably scrape off a year or two off learning one programming language after you know another, but that's a third of the time!)
robdog has quit [Ping timeout: 264 seconds]
Inline has joined #lisp
<no-defun-allowed>
The only alternatives I knew of were C++, Java and Haskell, and none of those looked great to me.
Adamclisi has quit [Remote host closed the connection]
<no-defun-allowed>
Of course, you can almost make an alphabet-teaching list using programming language names, but not every language is promoted equally.
robdog has joined #lisp
<bonz060>
no-defun-allowed: What made python for you unproductive? Do you think other people would share your opinion if they moved to CL? Personally, I'm looking into CL because of some sense of deep intellectual curiosity that is constantly being fired up at meet-ups and sometimes at work(when someone goes on a rant on how they wished one of our stack was in some form of lisp)
ggole has quit [Remote host closed the connection]
ggole has joined #lisp
<bonz060>
no-defun-allowed: Since you've been using CL for 1.5 years, what was your learning path?
<no-defun-allowed>
The interactive REPL/SLIME interface is pretty much why I stuck around, since it gets you out of the slow run-fix-restart loop.
rtypo has joined #lisp
heisig has joined #lisp
<no-defun-allowed>
Common Lisp is pretty dynamic and utilises a lot of late binding to redefine classes and functions at runtime.
milanj has joined #lisp
robdog_ has joined #lisp
<verisimilitude>
Common Lisp is more dynamic than Python, but also more efficient, bonz060, in addition to having a standard with multiple implementations.
<verisimilitude>
This alone seems like a good reason over Python.
robdog has quit [Ping timeout: 252 seconds]
<no-defun-allowed>
Yeah, CL is also much much much faster, somewhere around 1.5 to 3 magnitudes usually.
<akater>
What is the point of quicklisp-slime-helper? It creates a config potentially duplicating and potentially contradicting init.el, and it depends on alexandria. I don't see how it's useful at all.
robdog_ has quit [Ping timeout: 250 seconds]
<no-defun-allowed>
I've had better luck grabbing SLIME from MELPA, honestly.
<akater>
A newcomer is eager to use it, and I just don't think it's a good idea which is weird since Xach made it (?).
<no-defun-allowed>
But, if the moon is positioned correctly, it works well enough to get SLIME running for a while.
<bonz060>
no-defun-allowed: Tooling made you stick?
* no-defun-allowed
will nod off to bed now.
<bonz060>
no-defun-allowed: Cool. It's 14:00hrs in my country
<akater>
bonz060: Arguably, every Lisp user is into language design. “In Lisp, you don't just solve a problem, you write a sublanguage to solve it in.”
<no-defun-allowed>
Yeah, SLIME is pretty damn good, I think only Interlisp and a few Smalltalk IDEs compare.
<no-defun-allowed>
Though, the language I designed isn't a Lisp, since I already wrote a transpiler for a friend's Lisp-lookalike and it wasn't very exciting.
<verisimilitude>
If you're just starting out, this is one of the only things CLISP is good for.
<bonz060>
akater: Why is language design so intriguing? As far as I'm concerned(at least for me), I want to get shit done in a way that I won't hate myself 2 weeks from now. I also get that "language design" vibe from some hard core haskellers. What's so fascinating about language design?
<verisimilitude>
Language design saves typing, to boil it down to its lesser base.
<no-defun-allowed>
CLISP is the best out of the box, yeah. Fun fact: CLISP was freed after an argument between the developer and RMS about licensing on readline.
karlosz has quit [Quit: karlosz]
<akater>
bonz060: My point is, in Lisp people tend to do it not because it's fascinating but because it's natural in their workflow.
<verisimilitude>
I'm familiar with it, yes, no-defun-allowed; interestingly, it's not mentioned by name when it's mentioned that putting unique libraries under the GPL resulted in at least one program being released under the GPL.
<verisimilitude>
This is as opposed to the LGPL.
<no-defun-allowed>
Macros make it pretty simple for simple changes, and code walking (except for arbitrary CL, ironically) is trivial in Lisp.
<akater>
bonz060: but yes, everything becomes intriguing and fascinating once you get productive with it.
karlosz has joined #lisp
* no-defun-allowed
is now going to sleep, please defer questions to someone who isn't half asleep thanks (:
milanj has quit [Read error: Connection reset by peer]
wanz has quit [Quit: wanz]
heisig has quit [Remote host closed the connection]
robdog has quit [Ping timeout: 250 seconds]
frodef has quit [Ping timeout: 255 seconds]
p9fn has joined #lisp
robdog has joined #lisp
<bonz060>
Thanks guys for all the help :)
wanz has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
<beach>
Pleasure.
milanj has joined #lisp
varjag has joined #lisp
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
milanj has quit [Read error: Connection reset by peer]
<shka_>
i personally don't even like macros all that much ;-)
<p_l>
meanwhile I think I'm facing writing more and more of them
<p_l>
it's hard to otherwise implement pseudo new special forms :)
robdog has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
milanj has joined #lisp
robdog has joined #lisp
izh_ has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
robdog has joined #lisp
milanj has quit [Read error: Connection reset by peer]
robdog_ has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
milanj has joined #lisp
orivej_ has joined #lisp
robdog_ has quit [Ping timeout: 264 seconds]
shka_ has quit [Quit: Konversation terminated!]
orivej has quit [Ping timeout: 255 seconds]
scymtym has joined #lisp
lumm has joined #lisp
robdog has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
milanj has quit [Read error: Connection reset by peer]
lumm has quit [Client Quit]
lumm has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
milanj has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 250 seconds]
Lord_of_Life_ is now known as Lord_of_Life
bonz060 has quit [Read error: No route to host]
milanj has quit [Read error: Connection reset by peer]
sonologico has joined #lisp
robdog has joined #lisp
wanz has quit [Quit: wanz]
shka_ has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
<aeth>
verisimilitude: I wouldn't say that CL is more dynamic than Python. Common Lisp can be dynamic, and it can be not particularly dynamic, and really, quite the opposite of it if you hardcode everything in one giant macro that generates one function.
<aeth>
What I think CL does is give you the choice of what level of abstraction to work in.
FreeBirdLjj has quit [Remote host closed the connection]
robdog has quit [Ping timeout: 250 seconds]
robdog has joined #lisp
<p_l>
I'd say CL is less dynamic than Python, but that's related to obscure details of implementation in Python
<p_l>
you can program in similar style in CL, but it's very old and low-efficiency in terms of speed way
<p_l>
no-defun-allowed: funnily enough, RMS position is afaik not necessarily defended by GPL
robdog has quit [Ping timeout: 264 seconds]
FreeBirdLjj has joined #lisp
wigust has joined #lisp
frodef has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
Ukari has quit [Remote host closed the connection]
milanj has quit [Read error: Connection reset by peer]
lavaflow has quit [Read error: Connection reset by peer]
lavaflow has joined #lisp
bonz060 has joined #lisp
Essadon has joined #lisp
Essadon has quit [Max SendQ exceeded]
Essadon has joined #lisp
robdog has joined #lisp
wanz has joined #lisp
pfdietz has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
makomo has joined #lisp
lucasb has joined #lisp
troydm has quit [Ping timeout: 250 seconds]
makomo has quit [Ping timeout: 250 seconds]
robdog has joined #lisp
<MichaelRaskin>
Hm. Can I submit a task in lparallel without creating a new anonymous function per task? Or what is recommended to use if I want to submit a lot of tasks with the same function and different arguments?
<_death>
submit-task takes a rest list of args to pass to the function
robdog has quit [Ping timeout: 250 seconds]
lumm has quit [Quit: lumm]
lumm has joined #lisp
<MichaelRaskin>
Indeed; but submit-task definition refers to task-lambda which creates a new function via flet
<_death>
so you have an answer to your question ;) .. do you think it would be worth it to separate the context?
<MichaelRaskin>
I don't hae the answer to my complete question — what can I use for a thread pool without anonymous function per task
robdog has joined #lisp
<_death>
I don't think lparallel cares too much about that level of performance
<_death>
sb-concurrency seems more tuned for it
robdog has quit [Ping timeout: 252 seconds]
<MichaelRaskin>
Sigh. I hope for some portability…
<_death>
lparallel also exposes a queue interface and implementations, but I don't recall them being too clever
bonz060 has quit [Ping timeout: 240 seconds]
izh_ has left #lisp [#lisp]
<Grue`>
MichaelRaskin: you can have a bunch of workers per thread and each of them would grab args from queue and run your function in a loop
<MichaelRaskin>
Yes, I hoped to grab a library that already does that…
<Grue`>
correction, I meant "a bunch of workers (one per thread)"
<MichaelRaskin>
Although maybe I am too pessimistic and my tasks (which write some files, and often spawn external programs) are not that cheap…
<Grue`>
counting the amount of generated lambdas sounds like premature optimisation to me
<MichaelRaskin>
Ah indeed it's not that bad probably
<MichaelRaskin>
Hm, I wonder if htop is a good tool for monitoring load
<MichaelRaskin>
Or maybe I should have set channel size in some place
Bike has joined #lisp
<_death>
there's also iotop
<Grue`>
atop is the best
robdog has joined #lisp
<MichaelRaskin>
atop never really tells me what I want to find out
knicklux has quit [Remote host closed the connection]
<MichaelRaskin>
iotop says the workers write but don't really block on IO
<MichaelRaskin>
(which hs is as expected)
<MichaelRaskin>
htop says the main thread is loaded, and workers are only lightly loaded
paul0 has joined #lisp
<_death>
usually you should start with some target performance in mind
<_death>
otherwise, it's an endless endeavour ;)
robdog has quit [Ping timeout: 264 seconds]
<MichaelRaskin>
I want the sum total of worker threads CPU share be larger than the main thread CPU share
Zaab1t has joined #lisp
vilivulpine has quit [Ping timeout: 264 seconds]
<_death>
create more workers :)
<_death>
or give them bigger chunks
igemnace has quit [Quit: WeeChat 2.4]
<MichaelRaskin>
More workers just drops per-worker CPU usage
igemnace has joined #lisp
CCDelivery has joined #lisp
<shka_>
MichaelRaskin: don't care about lambdas at this stage
<MichaelRaskin>
Well, now I have checked that lambda generation does indeed pass instantly
<shka_>
closures allocation is usually surprisingly fast
<shka_>
so don't worry about it
<shka_>
do you have a concrete example of code you are trying to optimize?
<MichaelRaskin>
Too large, unfortunately
<White_Flame>
the vast majority of allocations are just a pointer bump & range check, without even a function call
<shka_>
indeed
<shka_>
MichaelRaskin: try using sbcl sprof
<shka_>
it is the gift from the gods
<MichaelRaskin>
Now I am trying to see if something can lock and force effectively single-threading operation
<shka_>
right
pfdietz has quit [Quit: Page closed]
ghard has quit [Remote host closed the connection]
pfdietz has joined #lisp
robdog has joined #lisp
wanz has quit [Quit: wanz]
wanz has joined #lisp
Ukari has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
robdog has joined #lisp
wanz has quit [Quit: wanz]
jb__ has quit [Ping timeout: 245 seconds]
lemoinem has quit [Ping timeout: 245 seconds]
robdog has quit [Ping timeout: 258 seconds]
lemoinem has joined #lisp
frodef has quit [Ping timeout: 250 seconds]
robdog has joined #lisp
Achylles has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
McParen has joined #lisp
Achylles has quit [Ping timeout: 257 seconds]
buffergn0me has quit [Remote host closed the connection]
buffergn0me has joined #lisp
slaterr has joined #lisp
admich has joined #lisp
CCDelivery has quit [Ping timeout: 250 seconds]
ebrasca has quit [Ping timeout: 255 seconds]
jb__ has joined #lisp
sariyar has joined #lisp
ym555 has joined #lisp
trocado has joined #lisp
admich has quit [Quit: ERC (IRC client for Emacs 26.1)]
puchacz has joined #lisp
<puchacz>
hi, how to print a stacktrace, java style, from error object into a string please?
<puchacz>
I want it for loggin
<puchacz>
g
<puchacz>
okay, I found (trivial-backtrace:print-backtrace-to-stream s)
<puchacz>
:-)
robdog has joined #lisp
<jackdaniel>
puchacz: make sure to invoke it from the handler-bind, not handler-case
<jackdaniel>
because the latter executes the handler body with the stack already unwound
robdog has quit [Ping timeout: 252 seconds]
<puchacz>
jackdaniel - thanks!
robdog has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
buffergn0me has quit [Read error: Connection reset by peer]
buffergn0me has joined #lisp
robdog has joined #lisp
Josh_2 has joined #lisp
<puchacz>
what's the difference between handler-bind with binding for error as type vs t as type?
ravenousmoose has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
<Xach>
puchacz: not everything signaled is an error
<Xach>
puchacz: t will handle everything, error will only handle errors
<puchacz>
Xach: what can be signalled that is not an error?
<Xach>
puchacz: anything that is a condition but not an error
<puchacz>
and for "production", I think I should have t not error for graceful handling, i.e. showing the user "internal error" page rather than crashing sbcl, right?
<jackdaniel>
puchacz: for instance a warning, style-warning
<Xach>
puchacz: it's the condition system, not the error system!
<jackdaniel>
or your custom condition `value-emitted`
<Xach>
my progress bar signals "hey, some progress happened", which is not an error
<jackdaniel>
in fact I use it for asynchronous result signaling (and sent via websocket)
<jackdaniel>
but when not in websocket context it is simply ignored
<puchacz>
if I do not bind for something that is not an error but a different type of condition, will it crash sbcl?
<Xach>
puchacz: no
<puchacz>
so do only unhandled errors crash it (when no debugger is present etc.)?
<Xach>
"crash" seems a bit more pejorative than necessary.
<Xach>
the configured debugger might exit instead of offering options.
<Xach>
truly crashing is pretty bad!
<jackdaniel>
puchacz: only serioud-conditions unhandled require interactive assistance
<jackdaniel>
serious*
<puchacz>
okay, so I should be fine for binding and reporting errors only
<jackdaniel>
even better: bind and report serious-conditions!
admich has joined #lisp
<puchacz>
yeah, it sounds pejorative, I realise it is a reasonable behaviour, if I intentionally remove debugger, what else should it do rather than quitting?
<puchacz>
serious-condition is a type I take?
<jackdaniel>
(timeout is not an error, still a serious-condition, same goes for out of memory conditions)
<jackdaniel>
yes, error inherits from the serious-condition
<puchacz>
good, I shall do it
<puchacz>
thanks :)
<jackdaniel>
sure
orivej_ has quit [Ping timeout: 255 seconds]
<puchacz>
btw, we can say crashing when it wants to land in ldb I guess
<Xach>
ldb is so bad, i turn it off
<Xach>
i don't want my server program sitting in ldb waiting for attention, ever
<puchacz>
I have it turned off in prod
xkapastel has joined #lisp
<puchacz>
and I quit it manually when it happens in dev computer, because I don't know how to use it :)
<jackdaniel>
slaterr: I think you've meant it to post it on #haskell
<slaterr>
yes, wrong window
<pjb>
Still interesting.
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ravenousmoose has joined #lisp
orivej has joined #lisp
jcowan has quit [Ping timeout: 264 seconds]
jcowan has joined #lisp
<fiddlerwoaroof>
I don't really understand ldb
<fiddlerwoaroof>
I guess, if you're working on sbcl or something, it would be useful
<fiddlerwoaroof>
But, since there's not really any way to recover once you enter it, it's never been very useful for me
<fiddlerwoaroof>
Now, if you could tell it to resize the dynamic space and continue, or something, it might be useful when you accidentally read in a huge file or something
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
<Bike>
i think ldb is mostly intended for development, yhes
robdog has joined #lisp
robdog_ has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
comborico1611 has joined #lisp
makomo has joined #lisp
<drewc>
ldb can be quite useful when trying to track down things that require it. For me, it was UCS-2 + Oracle + C + sockets + SBCL with the new UNICODE string encoding. That was the one time I have ever needed it, and it was quite literally tracking bits and bytes after crashes.
robdog_ has quit [Ping timeout: 250 seconds]
ebrasca has quit [Remote host closed the connection]
<comborico1611>
How does one run a file from interpreter?
<pjb>
comborico1611: Mu
robdog has joined #lisp
<pjb>
comborico1611: LOAD
<comborico1611>
Ahh! Thank you!
<pjb>
comborico1611: there's no interpreter, there's a REPL = Read Eval Print Loop.
<pjb>
comborico1611: the repl can use any implementation strategy to evaluate the expressions.
<comborico1611>
I see. Thank you.
<pjb>
comborico1611: we don't run a lisp file, we load (or compile-file) it.
<comborico1611>
I am able to LOAD the source code, but when trying to LOAD the compiled (fasl) file, I get an error.
<pjb>
This may occur, when the file is ill-designed.
<comborico1611>
I see. I will look for errors. Thank you.
robdog has quit [Ping timeout: 264 seconds]
Oladon has joined #lisp
orivej has quit [Ping timeout: 246 seconds]
myrkraverk has quit [Ping timeout: 246 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
robdog has joined #lisp
<comborico1611>
Is there a special term for assigning a value to a global variable by calling a function whose lamda list contains that global value?
McParen has left #lisp [#lisp]
FreeBirdLjj has quit [Ping timeout: 255 seconds]
robdog has quit [Ping timeout: 252 seconds]
<pjb>
comborico1611: local dynamic binding.
<pjb>
comborico1611: there's no difference between a parameter binding (lambda list) and a local variable binding in a LET, LET*, PROGV or PROG.
Zaab1t has quit [Quit: bye bye friends]
robdog has joined #lisp
<comborico1611>
Is this unique to Lisp?
<pjb>
Yes.
<pjb>
More precisely, there are other languages where the bindings are dynamic, but few of them. Mostly by accident.
<pjb>
Usually programming languages provide only lexical binding.
myrkraverk has joined #lisp
<pjb>
But in most languages, there's no difference between a parameter and a local variable: even a input parameter (by-value), you can usually assign to it: int f(int a){ a=2; return a; } f(3) -> 2
<makomo>
ello
robdog_ has joined #lisp
<Bike>
that's just a dynamic binding, if i understand what you're saying
robdog has quit [Ping timeout: 252 seconds]
frodef has joined #lisp
robdog_ has quit [Ping timeout: 264 seconds]
nanoz has joined #lisp
<Grue`>
comborico1611: I'm not sure what "lambda list contains that global value" means. if you're passing the value to function changing it won't change the value of the global variable unless you mutate it
<Bike>
you would need to know how to pull things out of an action-container.
<Bike>
obviously action-containers are not part of the standard language.
<comborico1611>
Grue`: Example: (defun bob (value *global-variable*) (BODY)) So calling (bob 2 'barker) would set global variable to barker.
<Grue`>
(funcall (slot-value (nth *school-operations* n) 'add-list) ...) would probably work
<pjb>
comborico1611: in that cas, value is a normal lexical binding, as long as value is not a special variable.
<pjb>
comborico1611: but *global-variable*, assuming it's a special variable will be dynamically bound.
<Grue`>
comborico1611: it won't set *global-variable* to barker because it creates a new scope
<pjb>
(defvar *d* nil) (defun g () *d*) (defun f (*d*) (g)) (f 42) #| --> 42 |#
<pjb>
(g) #| --> nil |#
nanoz has quit [Ping timeout: 255 seconds]
<comborico1611>
It's so bazaar how a variable can be "loaded" with functions.
<pjb>
It's not overloaded, because it's not the variable. It's the name.
milivoj has joined #lisp
<pjb>
A single symbol can be used to name a variable (multiple variables actually), zero, one or more functions, but also other things, such as types, classes, tags, slots, etc.
<comborico1611>
The author writes as if the accessor functions are implicitly defined from the subsequent creation of the structure.
<comborico1611>
Yet, when I run the author's code, I get undefined function for OP-ADD-LIST.
<makomo>
comborico1611: works for me
<buffergn0me>
comborico1611: Indeed the accessors are defined by defstruct. How are you trying to run the code?
<_death>
you can see for yourself with (macroexpand-1 '(defstruct op action preconds add-list del-list))
<Grue`>
maybe you're in a different package?
xkapastel has quit [Quit: Connection closed for inactivity]
specbot has quit [Read error: No route to host]
minion has quit [Read error: No route to host]
minion has joined #lisp
specbot has joined #lisp
robdog has joined #lisp
orivej has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
<comborico1611>
Very annoying -- I don't know why I must retype type the quote marks. But for some reason, I must retype them. I was going to run the code directly from book. (I changed names of things for my understanding.)
<comborico1611>
buffergn0me: Here is the full program. But quotes are not registering correct on my Emacs. https://pastebin.com/qE19McPf
<_death>
the book was OCRed and the program used non-ascii quotes..
<buffergn0me>
comborico1611: Some program is "helpfully" replacing regular quotes with Unicode smart quotes
<buffergn0me>
Common problem with copy-pasted data on Windows and Mac OS
<pjb>
djeis[m]: it doesn't depend on the CL implementation. Any conforming CL implementation WILL HAVE to use with-compilation-unit (or the same effect) in compile-file, or it won't be a conforming implementation of ANSI CL!
robdog has joined #lisp
karlosz has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
<buffergn0me>
That's true, but what can you rely on WITH-COMPILATION-UNIT for? The only thing seems to be that forms are evaluated left to right
jtecca has quit [Remote host closed the connection]
robdog has joined #lisp
<pjb>
buffergn0me: it won't signals undefined function warnings when functions are defined after their use.
Adamclisi has joined #lisp
<buffergn0me>
pjb: According to my reading of the CLHS, it's not even guaranteed to do that
<buffergn0me>
And it won't solve use-before-definition issues
<pjb>
Anyways I'm in the define-before-use school.
puchacz has quit [Quit: Konversation terminated!]
lumm has quit [Quit: lumm]
lumm has joined #lisp
<buffergn0me>
Yeah, it definitely keeps things simple. There are a lot of things to be said about module systems that treat files/modules as units, simplicity and efficiency are not part of those things
random-nick has quit [Read error: Connection reset by peer]
trocado has quit [Ping timeout: 245 seconds]
robdog has joined #lisp
rumbler31 has joined #lisp
robdog has quit [Ping timeout: 264 seconds]
<pjb>
I'm even more in the school: let emacs store the toplevel forms in the positions it determines itself by a topological sort.
rumbler31 has quit [Ping timeout: 245 seconds]
myrkraverk has joined #lisp
<buffergn0me>
pjb: Is that a SLIME contrib?
Oladon has quit [Quit: Leaving.]
charh_ has joined #lisp
charh_ is now known as char
char is now known as charh_
myrkraverk has quit [Ping timeout: 244 seconds]
charh has quit [Ping timeout: 244 seconds]
charh_ is now known as charh
robdog has joined #lisp
<pjb>
buffergn0me: nope. AFAIK, it's not implemented yet.
<pjb>
Perhaps I will eventually implement it.
<pjb>
That would free people of the burden of spreading their toplevel forms to several files, etc. This would be handled automatically.
<buffergn0me>
From what I undestand, Interlisp could do that
<verisimilitude>
I find it stupid when a language forces files to be orthogonal with compilation units. Avoiding this is much more flexible, I think, and avoids the mess with largely superfluous files littered about.
robdog has quit [Ping timeout: 264 seconds]
<verisimilitude>
I prefer my libraries to be single-file anyway, though.
myrkraverk has joined #lisp
<buffergn0me>
Well, you could have a compilation unit be a set of files in an ASDF definition
<pjb>
well, files are stupid to store code. They're good on a unix system, but interlisp allowed image-based development, and other ways to store the sources could be useful, with nice tools to query and navigate the source. For example, since we have multiple dispatch methods, we may want to see all the method dispatching on class A, and then all method dispatching on class B, then a (defmethod moo ((a a) (b b)) …) would appear in
<buffergn0me>
But then you also need it to be a unit when you COMPILE-FILE
<_death>
I have a catjava utility to concatenate all java files.. then I use a hide-comments function.. then I can read the code :)
<aeth>
I disagree. With files, you have a known working state you can inspect completely. With images, well, let's just say I use M-x s-r-i-lisp a lot.
rumbler31 has joined #lisp
<aeth>
Sure, you could have a presentation layer on top of files that selects e.g. all of the method source code.
* gilberth
imagines an emacs extension where one buffer holds multiple files.
<pjb>
aeth: think database instead of file.
<Xach>
akater: quicklisp-slime-helper is a way to get slime without much other setup. it is guaranteed to be synced with the quicklisp swank version. if you have another way to get and init slime, there is no advantage. it's pretty handy on a "cold" system in my experience. it predates emacs packages being very convenient.
izh_ has left #lisp [#lisp]
<pjb>
Having a static "script" to reproduce a similar image is god, but it doesn't imply using files. The source can be stored in a database or otherwise.
<aeth>
pjb: But I don't want to think database instead of file. The files are essentially scripts that create a reproducable working state
<verisimilitude>
You could have image-based development with CL if implementations had FUNCTION-LAMBDA-EXPRESSION work well every time.
<pjb>
aeth: they're a simple solution granted. But again, newbies and a lot of people seem to have problem organizing themselves, so if it can be automatized, soon you can see that you can use other storage systems.
<pjb>
The point is not file vs database, is manual vs. automatic.
<verisimilitude>
Modern file systems don't even have versioning, as they lost it, so it's bad all-around.
vilivulpine has joined #lisp
Aruseus has quit [Remote host closed the connection]
<aeth>
pjb: The problem is tools. It doesn't take much to go from M-. (which will always work and take you to the first line, except for some rare C-c C-c cases) and paredit etc. to being able to create new "files" of every defmethod foo
robdog has joined #lisp
<verisimilitude>
I hate that SBCL's MAKE-PATHNAME ignores file versions.
<aeth>
verisimilitude: file systems don't have versioning but we have the 80% solution of git, which we can use for all of the important text files
adip has joined #lisp
<aeth>
Manually of course.
robdog has quit [Ping timeout: 252 seconds]
<buffergn0me>
gilberth: That is what WGREP-CHANGE-TO-WGREP-MODE does in GNU Emacs grep buffers. Essentially displays and edits subsets of multiple files in one buffer
<verisimilitude>
We have git, an ugly, manual, explicit, and worse implementation of part of a real file versioning system, yes.
<aeth>
git's not too bad with magit
<buffergn0me>
gilberth: Occur has a similar editing mode
<aeth>
verisimilitude: Every file being versioned would have to solve more problems, like binary files and unimportant files and things like password files
<buffergn0me>
gilberth: I'm working on one for Cscope
<verisimilitude>
That's typically how UNIX adds features.
<verisimilitude>
It's already been solved, aeth.
<aeth>
We typically see an ugly solution for 80% of the problem
<aeth>
verisimilitude: distributed and networked like git?
<_death>
verisimilitude: versioned files is wrong.. and git is progress, as it tracks not files but changes
<buffergn0me>
verisimilitude: The problem with per-file versioning is that it is only as powerful as CVS. You want to track changes across multiple files at once
<verisimilitude>
You can build that on top of a real file system with versioning.
<buffergn0me>
Also, Emacs has VERSION-CONTROL, which acts like a versioned filesystem
<buffergn0me>
I use it for everything
<verisimilitude>
You could even have the file system have a means for relating files in this way, when it becomes understood that a file isn't just a bag of bytes and can have real attributes.
<buffergn0me>
verisimilitude: Are you referring to filesystem snapshots like ZFS/BTRFS has?
<verisimilitude>
No.
myrkraverk has quit [Ping timeout: 255 seconds]
trocado has joined #lisp
<verisimilitude>
File versioning is when you save changes to a file, you still have access to the file's older version and yet older versions.
makomo has joined #lisp
<verisimilitude>
A snapshot is another example of getting partway to the solution, poorly.
<aeth>
I have emacs store them all in .~ so e.g. ~/foo.txt will have ~/.~/foo.txt~1~ etc. and it will never delete old ones because I set it like that. Emacs only does this if it doesn't detect it's in version control (it even does it for files in version controled directories that aren't themselves version controlled!)
<pjb>
name.type.~version~ Unfortunately most implementation cannot translate logical pathnames versions. For example, ("H:**;*.*.*" "/**/*.*.~*~") translates #P"H:tmp;foo.bar.42" to "/tmp/foo.~bar" in ccl.
<pjb>
completely broken.
<aeth>
I still prefer git to Emacs's backup system because per-file has major problems once you move past one file. Does foo.txt~123~ line up with bar.lisp~57~ or do they not even line up at all because I never had a working state among the backups? (git, since you explicitly check in, ideally has every combination of files working)
<verisimilitude>
I have a question about git, _death, since you asked me to use it before.
<verisimilitude>
Does git require projects to be in dedicated folders or such things?
<buffergn0me>
aeth: I put everything in a single folder in my home directory (full pathname gets appended to filename that way), even files in VC. It's a good backup system, not a very good version tracking system
robdog has joined #lisp
<_death>
no.. it's only requirement is for a repository to be in a directory, and the git database is then a .git directory in that directory
quazimodo has joined #lisp
<_death>
*its
quazimod1 has joined #lisp
quazimod2 has joined #lisp
quazimod2 has quit [Client Quit]
quazimodo has quit [Client Quit]
<verisimilitude>
So, a directory beyond the containing directory is required at some point?
<_death>
no
quazimodo has joined #lisp
<verisimilitude>
Well, that's good then; my website is completely flat and I wouldn't want to change that.
<_death>
that's no problem.. just do: git init ; git commit -am 'initial commit' and you have a repository
rtypo has quit [Ping timeout: 245 seconds]
<_death>
(ok, need "git add ." before the commit)
<verisimilitude>
I've still yet to learn how to use git, along with deciding whether I will, but if I'm not required to introduce directories, then that doesn't rule it out.
<_death>
the only thing this does is create a .git directory with the database containing the current state
slyrus_ has joined #lisp
frodef has quit [Ping timeout: 244 seconds]
myrkraverk has joined #lisp
<_death>
you can inspect it using a tool like gitk, change stuff and use "git gui" for easily committing (or see http://emacsrocks.com/ episode 17 ;), and finally delete the .git directory if you're not satisfied
slyrus__ has quit [Ping timeout: 245 seconds]
<_death>
one thing that you shouldn't do is have the .git directory as-is on your server
robdog has quit [Ping timeout: 264 seconds]
robdog_ has joined #lisp
<verisimilitude>
Alright; I'm very wary about file I didn't create myself that are public, as is.
robdog has joined #lisp
jmercouris has joined #lisp
phoe has quit [Quit: leaving]
<_death>
also, re-watching that episode, it's not really an introduction to magit.. so some other one is to be found
robdog_ has quit [Ping timeout: 264 seconds]
<nirved>
with GIT_DIR the local git repository can be somewhere else
robdog has quit [Ping timeout: 264 seconds]
themsay has quit [Ping timeout: 240 seconds]
themsay has joined #lisp
libertyprime has joined #lisp
libertyprime has quit [Client Quit]
libertyprime has joined #lisp
themsay has quit [Ping timeout: 255 seconds]
themsay has joined #lisp
robdog has joined #lisp
themsay has quit [Ping timeout: 255 seconds]
<_death>
(on first use, git may ask you to set a name and an email.. they should also add blood type, may come handy on one stressful day ;)
<verisimilitude>
Perhaps the Japanese distributions of git already do this.
edgar-rft has quit [Quit: Leaving]
robdog has quit [Ping timeout: 252 seconds]
themsay has joined #lisp
jmercouris has quit [Remote host closed the connection]