phoe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <> <> <> <> | SBCL 1.4.16, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
<LdBeth> Pure means purely mathematical
<pjb> tsizz: the goal of a teacher is to maximize the teaching of what he has to teach, while minimizing his work (eg. answering to questions accessory to the teaching).
<tsizz> my slide basically says no side effects, no iteration and no need for global state
<pjb> tsizz: so he will choose a simplier language that may demonstrate more clearly the things he has to teach you, but which is not necessarily the language you would use to develop a real program.
<pjb> tsizz: hence languages such as basic, pascal, scheme, python.
<tsizz> no explicit assignments and values are only parameters from functions
<gilberth> *Sigh*
<tsizz> pjb: yeah i got you
<pjb> tsizz: they're languages that have been simplified so that whole classes of questions don't occur, so the teachers can concentrate on what he wants to teach.
<gilberth> Common Lisp is not like that. Even Scheme is not.
<gilberth> tsizz: Pure functional programming concepts are an important topic. But neither Scheme nor Common Lisp force you to stick to it. It is just a teaching tool for your class in this case. Don't be fooled.
<tsizz> gilberth: perhaps that is how it was originally made?
<tsizz> my only functional programming knowledge is from javascript
<tsizz> "lisp is used in AI" interesting. never knew that
<gilberth> Yes and no.
<LdBeth> tsizz: if you aren’t gonna to study Godël’s type system then that’s all u need to know about functional programming
<aeth> tsizz: Purely functional programming is literally impossible in any useful program because of I/O. Newer languages like Haskell solve this problem with monads. If you want to know what a monad is... well, this isn't the place to ask, I certainly don't know.
<aeth> I'm assuming it's about contained side effects, though.
<tsizz> LdBeth: seems confusing lol
<aeth> Scheme's older solution is to just mark side effects with !, such as set-cdr!
<tsizz> haskell is next actually lol
<aeth> Common Lisp's solution is that it has no solution
<gilberth> aeth: I never got monads that either.
<pjb> tsizz: Have a look at "Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp".
<gilberth> I believe the most important think is, that functions are first class objects in Lisp. But then there are also in JavaScript, which is a Lisp with a very funny syntax.
<gilberth> thing, even. It's getting late, sorry.
<tsizz> thats basically all i know lol
<tsizz> pjb: interesting
<LdBeth> Monad is actually about an interface modify complex structures, in Haskell side effects are warped in those kinds of structures and that’s all
<gilberth> That book is a very good read.
<tsizz> im not sure if im going to learn lisp for real so im skeptical ill read it
<gilberth> Yes, they already brain-washed you. See.
<LdBeth> <gilberth "Yes, they already brain-washed y"> brain washers
<gilberth> You puzzle me.
<tsizz> i mean that article i linked before did intrigue me
<gilberth> LdBeth: Well, this is the classical story. Students are exposed to Scheme called a Lisp and are teached pure functional programming, which in general is hard to grasp. And then they think: "What a shitty language!"
<moldybits> tsizz: give PAIP a shot. it's one of my favorite cs books of all time. peter norvig (the author) has some very enjoyable videos on youtube, as well.
<tsizz> moldybits: sounds good ill check it out then
<LdBeth> Scheme’s not bad. Just a matter to personal taste to me.
<tsizz> gilberth: haha thats why my teacher gave us that article. the author explains his thoughts on that
<gilberth> tsizz: You will not regret it, believe me.
<tsizz> does vim run lisp/scheme/haskell if anyone knows
<LdBeth> Yes
<LdBeth> Although Emacs’s better
<moldybits> :)
Nomenclatura has joined #lisp
<LdBeth> You can get Spacemacs and they’re provide CL/Scheme/Haskell config out of the box with Vim like key bindings
<tsizz> ttoo late im alraedy into vim haha
<LdBeth> I switched to Emacs 3 weeks after just learned how to use Vim
<LdBeth> So not too late.
<gilberth> Long, long time ago I got my first Unix, which was Xenix [sic!]. First thing, I did was to unplug the speaker because of all the BELs. Next thing was to port uemacs to it.
<Elronnd> I always thought it was kind of sad that and both redirect to vim's website
<Elronnd> originally redirected to emacs website
<Elronnd> (and I say that as a religious vim-user)
<Elronnd> *emacs'
<LdBeth> GG
<moldybits> if they'd reimplement vim in vimlisp that'd probably kill emacs eventually.
orivej has joined #lisp
<moldybits> then again, given the choices made thus far they'd probably make it even more primitive than elisp, so i guess not.
<LdBeth> Vi sucks because they want vi key bindings on their car, rather than the choice of config lang
<LdBeth> For me I’m not comfortable writing elisp
<gilberth> Me neither.
<moldybits> what little elisp i've managed to learn has been well worth the effort.
<seok> How does CL handle conflicts in asnyc?
<LdBeth> Good question, you get locks
<LdBeth> Although there’s not standard way
<seok> So if different processes try to access the same variable on an unlucky occasion, one will get an error?
<LdBeth> But to catch the fashion there’s Actor models and process calculus abstract the low level
<gilberth> There will be no error.
<seok> CL will automatically wait until the variable is available?
<gilberth> No.
<seok> One function just won't be processed then?
<gilberth> No.
<seok> What will happen?
<gilberth> What is the concept of "a variable being available"?
<seok> 2 different processes writes to same variable (+ a 1) (+ a 2)
<seok> will the result always be (+ a 3)?
<seok> Is this guaranteed?
<gilberth> No.
<seok> So one will not be executed
<LdBeth> Usually you have local variables per thread
<gilberth> Both will be executed, but on unlucky circumstances one thread will have a "stale" value for 'a'.
* gilberth assumes that 'a' is global and shared.
<seok> What is the workaround?
<gilberth> Locks.
<seok> Could you elaborate please?
<seok> Can we manually force a thread to wait for lock to be released?
<gilberth> Well, when I understand the problem correctly. You want that if one thread tries to increment by 1 and the other by 2 you want a guarantee (sp?) that 'a' is incremented by 3, right?
<seok> yes
Lord_of_Life_ has joined #lisp
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
<gilberth> This has nothing to with Lisp. This happens in any language. The problem is: To increment a variable, you read its value, do the addition and write back the result. While you do the addition the value could be changed by another thread.
Lord_of_Life has quit [Ping timeout: 245 seconds]
Lord_of_Life_ is now known as Lord_of_Life
<tsizz> i don't really understand the difference is between static type checking from compiler vs. runtime
<gilberth> So you need to guard access to the 'a' variable. For that you use a lock. You have a lock for that variable. Before entering the increment operation (reading, incrementing, write-back), you aquire the lock and get exclusive access.
<tsizz> idk where to ask that :(
<gilberth> The compiler cannot read your mind on this.
<cryptopsy> >> Slimv is a SWANK client for Vim, what a SWANK client ?
<cryptopsy> apologies for missing characters, dust under keys eternally trapped
<aeth> cryptopsy: Swank is a way to communicate with a Common Lisp server over TCP, for interactive debugging development.
<aeth> Almost always locally. If you need to do it remotely, use an ssh tunnel
<aeth> cryptopsy: So it's sort of like LSP if you're aware of it
<cryptopsy> i mean, it says that right there, but what does it stand for
<aeth> Except it's CL-specific and a different feature set
<aeth> cryptopsy: I don't think it's an acronym, Lispers just like to SHOUT sometimes
<aeth> cryptopsy: It's not upper case in
Nomenclatura has quit [Quit: q]
<cryptopsy> don't automatically assume i know what a SHOUT is, afterall i barely understand function
Nomenclatura has joined #lisp
<aeth> cryptopsy: So for historical reasons Common Lisp is "case insensitive" by default in that it upper cases everything it reads, so foo becomes FOO. This means that Lispers are usually used to entering 'foo and getting FOO back. So a lot of Lispers randomly upcase things, including some who say LISP, randomly upcasing Lisp itself.
<aeth> It looks like shouting, that's why I said shouting.
caltelt_ has quit [Ping timeout: 245 seconds]
<aeth> It's actually sometimes useful to refer to functions (or macros) in upper case in prose, such as CAR and CDR and CONS, even though we always by convention write source code in lower case these days
karlosz has joined #lisp
<bjorkintosh> aeth, lisp is old and hard of hearing and has a noticeable speech impediment, so it THOUTH.
<cryptopsy> what a funny word
sjl has quit [Quit: WeeChat 2.2-dev]
<Josh_2> Its used to being shouted at through a gramophone
<aeth> cryptopsy: Every ugly part of software (and programming languages are just software) basically has to have a mini-history lesson because if it's ugly and everyone immediately notices it "historical compatibility" is probably the reason why it is the way it is.
<cryptopsy> is this what you meant by advanced in the other channel
<aeth> The only thing worse than a mildly ugly feature is writing something that worked 10 years ago and no longer works today. Except a lot of people no longer hold that attitude, which is why in some ecosystems you have to rewrite your software every few years. What a mess.
<cryptopsy> does anyone have slimv emerging in gentoo?
<Josh_2> No I have Emacs in Gentoo :P
<Josh_2> So used Sly
<aeth> cryptopsy: Well, Scheme is more consistent because it broke backwards compatibility with early Schemes
<aeth> (and Racket itself broke backwards compatibility with Schemes a while back by making cons cells immutable)
comborico1611 has joined #lisp
<aeth> cryptopsy: With Common Lisp, you can run LISP 1.5 (in this case LISP because they had no lower case on computers back then!) programs with minimal changes. It values backwards compatibility, so it has some rough edges that you either just have to accept or learn why it is the way it is
<aeth> This also means it has some macros and functions that (almost) no one uses like PROG and RPLACA
<cryptopsy> i wonder if the swank from the simpsons is the same swank as in lisp, the show wad some writers which were math grad students
Arcaelyx has quit [Quit: Textual IRC Client:]
akoana has joined #lisp
<aeth> cryptopsy: To understand SLIME (Emacs) or Slimv (vim) you have to understand the Common Lisp workflow, which is fairly unique. Really, only one other language that I know of (Smalltalk) really thinks like this. It's about running things in an interactive image. It is basically like the REPL you might have seen in Python or JavaScript, except considerably more advanced.
<aeth> Lisp actually invented the REPL (read-eval-print-loop) and you can sort of get a primitive REPL just by doing (loop (print (eval (read))))
wrycode has joined #lisp
<cryptopsy> SWANKER: SWANK for R
<aeth> cryptopsy: Most programming languages think in the Unix way (usually because most programming languages are made for Unix and then later get ported to the other OSes) of having a text program that is compiled or interpreted, but essentially working at the file level.
<aeth> Common Lisp doesn't really necessarily care about files. You use something like ASDF (and Quicklisp on top of ASDF) to make it care.
<White_Flame> FORTH has a somewhat similar workflow to Lisp, except that there are more ordering issues on definitions
<White_Flame> or, on redefinitions specifically
kristof has joined #lisp
<aeth> cryptopsy: There are implementation specific ways to get an implementation like SBCL to load a file and treat it like it's a Unix scripting language (except implementations like SBCL are natively compiled! so the compiler will have to run first!), but what people commonly do when developing is just work directly in the interactive image, usually through something like SLIME or Slimv to make the REPL friendlier to work with.
<aeth> And if you're doing an advanced program the way to do an executable is to actually get an image and then save the image! In SBCL it's save-lisp-and-die.
<aeth> The distinction is the latter approach will bundle the language runtime with the executable, and the former approach requires you to have the implementation installed locally.
<aeth> But either approach is normally seen as the last step... what you do when you're done.
comborico1611 has quit [Quit: Konnection terminated!]
<aeth> When developing you just keep the interactive image running in the background, perhaps restarting it every now and then if things break or to make sure your program will work with a fresh image.
<aeth> This "in the background" Lisp has to run a swank server so your IDE (or whatever else) can talk to it.
<aeth> (It doesn't have to be swank, but if it's not swank, you'll probably have to write the server protocol yourself.)
<aeth> cryptopsy: All of that gigantic wall of text explains the design, but if you want you can just see how someone interactively codes Lisp live for a web stream (in this case, using Emacs).
<aeth> oh, hmm, I didn't link far enough into the video, that's about a minute too early
<aeth> Don't be intimidated by that video, though. He's more efficient at that sort of thing than most of us are because he does it for livestreams.
<Josh_2> I think cryptopsy gave up
<Josh_2> but I appreciated the wall of text
kristof has quit [Ping timeout: 250 seconds]
arescorpio has joined #lisp
<pjb> tsizz: the thing to understand in static type vs. dynamic type, is that in the case of static typing, the type is associated with the variable: any bit pattern stored in a variable of type T is interpreted according to the type T.
<pjb> tsizz: on the other hand, with dynamic typing, the type is associated with the value. The value can be stored in any variable, it brings with it its type. So you can never make a typing error with dynamic typing, because you always know the type of the value you have.
<Gnuxie[m]> does anyone have the lisp ying yang svg?
<pjb> tsizz: so when the variable is typed, you can blindly use the bit patterns stored as if they were of the type of the variable: this is fast, but if the bit pattern is invalid, this is catastrophic: you get crashes or worse like in C programs. The solution is to let the compiler prove that the bit pattern stored in typed variable are always valid, but this implies strong constraints on what you can do. cf. Haskell.
<aeth> pjb, tsizz: And you can have both at the same time, such as how SBCL typically interprets type declarations (which can be given meaning by implementations)
<aeth> It avoids the mess of something like Haskell or Java by... not really having the ability to get too elaborate in the types held by data structures, though. For the most part, you're holding T.
<pjb> tsizz: on the other hand, when the values are typed, you can check their type at run-time and perform checks or select your behavior according to it. This is slower, but much safer!
akoana has left #lisp ["Leaving"]
<pjb> tsizz: this extends to I/O too. For example, in C you can scanf("%d",&int_var); if you enter abc, or "hello" it breaks. (returns a status code). On the other hand, in lisp, you do (read), and the parser determines the type of the value in function of the syntax: 123 is an integer, 1.23 is a float, abc is a symbol, "hello" is a string, #(1 2 3) is a vector (a b c) is a list, etc.
caltelt_ has joined #lisp
<pjb> tsizz: so you can read values of any type. Then you can check or dispatch at run-time. It's safer.
<pjb> in OO languages, it's possible to use run-time dispatch, since object are dynamically typed. But some OO languages such as C++ allow for objects that are statically typed, and compilation-time dispatch. This has a lot of problems! You can assign an object to a variable typed by a superclass,and lose information! It's crazy.
caltelt_ has quit [Ping timeout: 246 seconds]
<aeth> pjb: CL can have compile-time dispatch, through several different libraries. e.g. and
<pjb> Yes, CL is a meta-programming programming language.
akoana has joined #lisp
<aeth> The difference, how you don't lose information, is that the tag is always there unless it's certainly safe to remove, e.g. double-floats in an array that holds the element-type double-float
<pjb> the tag is still there, in the array, factorized for all the elements.
<aeth> And that's why you only see it for something like double-float. If it worked for your class (or even struct!) foo it could have a distinct subclass. double-float is just double-float.
<aeth> would be an interesting problem to solve, though
ltriant has quit [Ping timeout: 255 seconds]
<White_Flame> even with subclasses, if the entire instance struct was inlined in the array space it could be done
<White_Flame> without removing the headers
<seok> Does clack require libev? getting errors trying to load it on windows portacle
<no-defun-allowed> well clack uses woo by default i think, which uses libev
<seok> nevermind! got it running with hunchentoot
kristof has joined #lisp
Ukari has quit [Remote host closed the connection]
<White_Flame> seok: are you using quicklisp?
<White_Flame> should solve most your issues
<seok> Yes I am using quicklisp, but Ive never been able to run woo or wookie on my setup
okeg has quit [Quit: WeeChat 1.6]
<seok> portacle on windows
<seok> Same issue, don't know how to install libev
<aeth> White_Flame: I was told that the problem with having proper array-of-structs in CL *was* subclassing, but I can see two solutions. (1) don't inline the child structure-class's fields but leave room for them somehow or (2) don't allow child structure-classes to work in those arrays
Ukari has joined #lisp
<seok> Not a problem though, I can use hunchentoot for development, then use woo on production linux server
<aeth> s/don't allow/don't allow instances of/
<White_Flame> aeth: actualy, yeah, you're right.
<kristof> can't find the logs so I don't know what cryptopsy said but I'm just using #!/usr/bin/env sbcl --script at the top of a small (1KLOC) lisp file I have
<aeth> White_Flame: The other problem you get is the semantics of aref, though. CL is not a language where copying really is a focus, and you wouldn't even want the copy-foo of a struct, you'd want a custom copy-foo-into.
<kristof> I'm using it for a build step.
<aeth> White_Flame: So to solve the latter you couldn't just use element-type, you'd have to use a different data structure
<White_Flame> aeth: it would basically require locatives
<kristof> Some code generation and preprocessing. The usual
<aeth> White_Flame: Can you define locatives? They're not on Wikipedia and it doesn't seem to be search-engine-friendly. (The modern search engine decides to show you completely irrelevant results instead of too-unpopular results or no results.)
<White_Flame> it's a proxy to an object
<White_Flame> technically a locative can simply be a pair of lambdas, a getter & setter
<White_Flame> but ideally it would be handled in the underlying runtime to be more transparent
<White_Flame> but, while that would work for reading such an inlined object in an array, it wouldn't work for placing an object into the array, as you mention above
<aeth> White_Flame: Well, it's easy to say that if you did (foo-ref your-data-structure 42) you'd just point to there with any reference. Setting is harder. I don't think setting really should be done at all. Just make the array-like data structure itself immutable, but its contents could potentially be mutable.
<White_Flame> since that would be a copy and would have to involve updating all references or create a new object instance
<aeth> What you'd want is a special kind of array that is adjustable, but also of a fixed size (so basically fill-pointer on a non-adjustable vector kind of logic), and a way to copy out and copy in.
<aeth> The contents would be immutable, but the contents of the contents could be mutable.
esrse has joined #lisp
<aeth> So if it's an array of foobars, they will forever be foobars, not even a subclass of foobars. And if you wanted to remove element #42 you could do something like copy the last element into the 42nd position and shrink the array down by one. That could even be built in since that's probably the most straightforward way to do arbitrary removal here.
<aeth> You would also be able to take a reference, since any helper functions would probably best work on that, such as functions that expect one argument, a foobar. No need to copy for that sort of thing.
<aeth> But since it's immutable (foo-ref foo 42) works but (setf (foo-ref foo 42) (make-subclass-of-foo ...)) would not.
<aeth> Now, there's immediately a difficulty here, though. If you delete 42 using the described deletion scheme, the index 42 now refers to a different element, which was previously the last element.
<aeth> (And similarly if you have a live reference to the 42nd offset into the data structure)
<aeth> I think that's the only remaining problem with this.
<aeth> You'd probably want to double index in practice (also makes it immune to sorting), but would you want this sort of double index thing to be built in or have to be managed manually?
<aeth> I can see why they didn't bother implementing something like this in the standard.
<aeth> s/implementing/specifying/
<aeth> It certainly *would* have to be done at the level of implementations, though, or at least partially.
X-Scale has quit [Ping timeout: 244 seconds]
X-Scale` has joined #lisp
X-Scale` is now known as X-Scale
<aeth> Oh, I overlooked that if 42 is the last element, then a stale reference to 42 is even worse because it's now (potentially) invalid instead of just the wrong valid option you get from if you deleted 42 from the middle or if you sorted.
cryptopsy has quit [Quit: cryptopsy]
<aeth> So I guess (aref foo 42) would have to use something locative(ish) if that's what a locative is. It'd have to know if foo got removed or moved, so the remove/move logic would have to be built into the data structure, too.
jack_rabbit has joined #lisp
kristof has quit [Remote host closed the connection]
<aeth> s/aref/foo-ref/
kini has quit [Quit: No Ping reply in 180 seconds.]
notzmv has joined #lisp
kini has joined #lisp
rumbler31 has joined #lisp
ltriant has joined #lisp
arescorpio has quit [Quit: Leaving.]
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
Bike has quit [Quit: Lost terminal]
wigust- has joined #lisp
wigust has quit [Ping timeout: 250 seconds]
karlosz has left #lisp [#lisp]
karlosz has joined #lisp
Nomenclatura has quit [Quit: q]
sjl has joined #lisp
<beach> Good morning everyone!
aindilis has joined #lisp
nanoz has joined #lisp
caltelt_ has joined #lisp
ym555_ has quit [Ping timeout: 250 seconds]
rumbler31 has quit [Remote host closed the connection]
<seok> Morning!
<seok> CL-WHO vs Spinneret?
<jeosol_> morning beach
quazimodo has joined #lisp
rumbler31 has joined #lisp
dddddd has quit [Remote host closed the connection]
keep_learning_M has quit [Quit: Leaving]
<verisimilitude> Which is smaller and what are the licenses, seok?
akoana has left #lisp ["Leaving"]
<aeth> There's other criteria. Benchmark? Write a toy program in both and see which API feels better?
<aeth> The license is definitely a good filter, though, I'll agree with that. I don't use anything LLGPL because it's a custom license not approved by the FSF or the OSI.
<aeth> And you can't use any license more restrictive than the license you intend on using. AGPL is the (near) universal receiver, MIT/BSD has to be a lot more careful.
<aeth> CL-WHO is BSD and Spinneret is MIT so essentially any program can use either (* not taking into account the unlikely event of software patents)
<tsizz> im sorta confused what S expression is
Oladon has quit [Quit: Leaving.]
<aeth> tsizz: the Wikipedia article seems to be fairly clear about it.
<tsizz> aeth: so its just the name of any expression and its parse tree
<tsizz> ?
<beach> tsizz: That might be because there are two meanings. One meaning is a Common Lisp data structure in memory made up of CONS cells and atoms. The other meaning is the textual representation of such a data structure.
<aeth> I think generally the diagram used for s-expressions is box-style instead of that tree-style, though... i.e. [ * | --]->[ 2 | --]->[ 3 | \ ] for (* 2 3) with any additional nesting going on rows below.
caltelt_ has quit [Ping timeout: 250 seconds]
<tsizz> so S expression is any object or function in between paraentheses that can be broken down into cons cells and atoms?
<beach> tsizz: You are mixing up the two meanings in that statement.
<beach> tsizz: Any Common Lisp data structure is made up of CONS cells and atoms. There is nothing else.
<aeth> tsizz: Oh sorry I added to the confusion. S-expression is the notation we use to represent the cons cells.
<tsizz> beach: mhm and S expression not related to that?
<aeth> tsizz: the box notation is an alternative representation, obviously a lot harder to type
<aeth> s-expressions are easy to type
<beach> tsizz: That is one meaning of S-expression.
<aeth> tsizz: imagine if you had to draw this to program instead of '(42 69 613)
<tsizz> thats what i said right? that s expression just easier way to write constant cons cells?
<beach> "constant"?
<tsizz> aeth: wait so is everything a linked list
<beach> tsizz: No, atoms are not linked lists.
<tsizz> beach: i meant instead of writting a lot of const cells u can write an easy s expression kind of
<aeth> tsizz: the syntax becomes a linked list, which is then processed, which could create anything
<tsizz> what are atoms
<beach> tsizz: Anything that is not a CONS cell.
<tsizz> im learning racket... and so idk if cons and atoms are the same. i think they are
<beach> tsizz: symbols, numbers, arrays, functions, etc.
<tsizz> beach: i thought all of those are made up of cons cells tho
<beach> tsizz: You are in the wrong channel then. This channel is dedicated to Common Lisp, and the terminology may be different.
<beach> tsizz: No, those are atoms, distinct from CONS cells.
keep_learning_M has joined #lisp
<aeth> tsizz: (make-hash-table) is, at a certain stage of the program `(make-hash-table) which is roughly equivalent to (list 'make-hash-table) or (cons 'make-hash-table nil) but at runtime it's a function call that returns a new empty hash table, not a list.
<beach> tsizz: Look in the glossary under "atom":
<aeth> and some things like #(1 2 3) or "123" are, at all times, never lists... they're atoms.
<tsizz> someone tried to explain to me atoms are numbers, booleans, etc. then S expression are basically atoms or lists of atoms
<tsizz> thoughts?
<beach> tsizz: Close.
<aeth> tsizz: but don't forget literal vectors and literal strings!
<tsizz> aeth: for atoms?
<beach> tsizz: That is what I wrote, twice, isn't it?
<tsizz> beach: im just confused as what the point of s expression is. if its a data structure like you said. it seems liek its a datatsructure holding a data structure
<aeth> tsizz: yes, an atom is simply not a cons.
<beach> tsizz: Sure, most data structures are recursive.
<tsizz> but a cons can hold atoms... right
<beach> tsizz: Yes, and other CONS cells too.
<tsizz> beach: is s expression the parentheses...?
<beach> tsizz: Now you are confusing the two meanings again.
<tsizz> or thats just evaluating expressions
<tsizz> oh gosh okay
<aeth> tsizz: There's essentially three stages going on. First you have a stream of characters. These are assigned meanings. Basically atoms or conses. And then this runs and becomes the program. So you can put a macro at either stage (the reader, or the s-expressions) to change the behavior of the earlier stages.
<aeth> tsizz: the parentheses actually are working at the reader level
<aeth> I think ( is a reader macro in Common Lisp. In fact, it looks like it is...
<Jachy> If you squint an S has a ( with a ) below it... but the s in s-exp stands for symbolic. It's just a format to represent expressions. In math you might have an expression like f(x, y) for a function call. With m-expressions you might see f[x;y]. With s-expressions, (f x y).
<tsizz> Jachy: wow that was a good explaination
<tsizz> but is it also evaluating it
<aeth> tsizz: The reason we care about if something is an atom or not is because of the stage when DEFMACRO works. The common kind of Lisp macro. A macro can take `(a b c) and turn it into something like `(setf b (* 2 c))
<aeth> (in that case, the macro has to have the name a)
<Jachy> That depends on what's looking at the expression and what the expression says.
<tsizz> aeth: sorry im not familiar with macros yet
<aeth> tsizz: evaluation doesn't have to happen.
<tsizz> im so confused lol
<Jachy> If my text editor has (format t "Hello~%") in it, it's an s-expression, but it's not being evaluated. I can tell Lisp to evaluate it, though.
<tsizz> Jachy: how?
<tsizz> u put it in a function and call it in console? thats how i'd do it lol
<aeth> tsizz: Most programming languages only have strings or charcter streams to work with. This makes it hard to write programs that write programs, or to add new syntax. By writing (f 1 2) instead of f(1, 2) we have a nice, regular notation that makes it easy to add new syntax.
<aeth> The regular notation is pretty important because we don't just have (f 1 2) we also have (+ 1 2)
<aeth> Most languages don't do +(1, 2) they do 1 + 2. And now to extend the language completely you have to teach it both prefix and infix.
<tsizz> mhm.. so an S expression is just any expression that fits the syntax of lisp basically..?
<tsizz> bc lisp is s expressed or something
<Jachy> You can do it that way, but you don't have to wrap it in a function. You can also run Lisp interactively from the console, it will prompt you for expressions to read, then evaluate, print the results, and loop back to the prompt. You'll see the phrase REPL for that behavior. You can also configure many editors to send the file contents directly to an already running Lisp process for evaluation.
<tsizz> so s expression is any expression in lisp bc its anything that contains atoms or list of atoms and that is what everything in lisp is made out of excluding cons
<tsizz> im trying to sum up what i think
<tsizz> sorry its late :(
<aeth> tsizz: Well, there are other syntax elements to Lisps. In Common Lisp, you get #x42 as a representation of the number 66 in hex. That uses syntax, but not s-expression syntax
borodust has joined #lisp
<aeth> So atoms can have their own syntax, and they can be different in different Lisps (and other Lisp-like languages)
<tsizz> aeth: okay but i mean for the most part the main parts are all atoms or list of atoms
<tsizz> aka s expressions
<tsizz> but isn't a list an atom? but a list is made of cons?
<aeth> tsizz: s-expression syntax is the (a b c) as shorthand for (a . (b . (c . nil))) as well as that longer (a . b) etc. syntax
<aeth> parentheses, dots, spaces.
<tsizz> aeth: mhm and thats cons cells right
<tsizz> 3 of them
<aeth> lists are cons cells, yes. (a . (b . c)) is also legal and that can be shortened to (a b . c)
<tsizz> aeth: mhm but if atom is defined as anything not a cons cell, then a list shouldn't be an atom?
<aeth> In Scheme, lists must end with '() which is their nil. In Common Lisp, dotted lists are lists, and the ones that end in nil are called proper lists. (This is a Common Lisp channel.) So in Common Lisp, lists and conses are essentially synonymous
sauvin has joined #lisp
<tsizz> aeth: ah okay racket documentation says list isn't a atom so that makes sense
<aeth> '(a b c) is a proper list whose cdr is '(b c) whose cdr is '(c) whose cdr is '() or nil (both are valid representations of nil)
<aeth> oh sorry, lists are either conses or nil in Common Lisp
<aeth> all of those are lists, only the first three are conses.
mulk has quit [Quit: ZNC -]
<aeth> In Common Lisp, you could define listp like this: (defun listp (object) (or (consp object) (null object)))
<tsizz> well lists are conses too right
<aeth> except for '() the empty list
<tsizz> mhm
<tsizz> why is it called cons
<tsizz> instead of pair
<tsizz> if they are the samething i think
<beach> tsizz: For historical reasons.
<aeth> Note that in Scheme/Racket list? uses the Scheme definition of list, which is proper list in Common Lisp. So (listp '(1 2 . 3)) is t in Common Lisp but (list? '(1 2 . 3)) is #f in Racket.
<aeth> So if you're writing list? for your Scheme implemnetation it afaik has to walk the entire list
<aeth> *implementation
<tsizz> wait proper list...
<tsizz> whats that
<aeth> '(1 2 3)
<aeth> it has to end in '()
<beach> tsizz: Look in the glossary, please.
<beach> tsizz: You need to get used to doing that.
rumbler31 has quit [Remote host closed the connection]
<aeth> tsizz: In modern terminology, the thing created by (cons 1 2) is a cons, a cons cell, a cons pair, or a pair. Interchangably, really. Schemes tend to call them just "pairs" (but still create them with cons) and Common Lisp's glossary just calls them "conses"
<tsizz> mhm
<tsizz> aeth: so what does the '() do...?
torbo has quit [Quit: ERC (IRC client for Emacs 26.1)]
<aeth> Hmm, apparently they can also be called "NATSes", but I've never seen that before. Also, just plain "cells".
<aeth> tsizz: '() is equivalent with nil in Common Lisp and in some Schemes.
<aeth> In Common Lisp, () is also equivalent.
<aeth> When to use which depends on context.
mulk has joined #lisp
<tsizz> aeth: is that just a under the hood thing for compiler?
<aeth> Well they all get parsed into the same object
<beach> aeth: You should be more careful with words such as "is" and "equivalent" when you are talking to people who are learning the terminology.
Inline has quit [Quit: Leaving]
<aeth> Generally, you use ()s without quotes only in macros which in reality makes it just '() since the macro's arguments are essentially just quoted.
<aeth> You'd use '() if you're talking about the empty list and nil in other contexts
<beach> aeth: '() is not equivalent to NIL or ().
<aeth> beach: it's not?
<beach> Only when they are evaluated, which you failed to mention.
<aeth> ah
<tsizz> aeth: mhm, but im confused why the distiniction of having to add '() to end of a list to make a proper list. like what for?
<beach> But tsizz is not into evaluation yet, because he/she has not understood what an expression is yet.
<aeth> tsizz: A proper list ends in '() but you normally don't see it. You only see its absence.
<beach> aeth: No, a proper list ends with the atom NIL.
<tsizz> beach: maybe i do haha my knowlede is a bit scattered. few weeks ago i had to do this hw and did it in racket in 2 days.
<aeth> tsizz: '(a . (b . ())) is '(a b) and not having it, e.g. '(a . (b . c)) would make it '(a b . c)
<aeth> So it's the last cons that has to end in the () or NIL
<tsizz> im still misisng the point of nil ending a list
<tsizz> or i mean '()
<aeth> tsizz: beach is right, it's () or NIL not '()
<aeth> it's not '(a . (b . '())) it's '(a . (b . ()))
<tsizz> i mean in racket (null? '()) is true
<aeth> when it's evaluated.
<tsizz> aeth: okay gotchu
<aeth> you have to be careful about quotes-in-quoted-forms
<aeth> in common lisp '(a . (b . '())) is (A B QUOTE NIL) instead of the (A B) you might expect
<tsizz> but im still confused on why u have a properlist structure that is just a list that ends in nil
<aeth> tsizz: '(a b c) ends in nil, '(a b . c) does not end in nil.
<tsizz> aeth: hm okay and they are both lists...?
<aeth> tsizz: that's so when you go over a sequence of conses, you can just look at the CAR to get all of the elements and stop when CDR is NIL
<tsizz> or is '(a b . c) a cons
<tsizz> aeth: ah okay
<tsizz> that makes sense
<aeth> '(a b . c) is the cons whose car is 'a and whose cdr is '(b . c)
<tsizz> aeth: but u just said that '(a b . c) doesnt have nil so its cdr can't be nil?
<aeth> it's a cons, and it's a list (in Common Lisp, not in Scheme), but it's not a proper list. It's a dotted or improper list.
<tsizz> hm common lisp more abstract than scheme or racket? seems like it with this
<tsizz> nvm idk
<tsizz> aeth: okay i gotcha thanks for all the help i really got to go to bed
<tsizz> thank you beach too
<tsizz> good night!
<aeth> tsizz: you normally just see proper lists, you can mostly ignore improper lists
<aeth> tsizz: good night
<tsizz> aeth: hence why racket has lists as just proper lists right
<tsizz> or a reason at least
<aeth> '(a b . c) normally shows up when you accidentally did something wrong :-)
<aeth> You usually do want that NIL at the end to terminate things, and having the existence of things that don't end in NIL is sort of a leaky abstraction.
<aeth> Just remember that '(a b c) is really just syntactic sugar for '(a . (b . (c . ()))) or '(a . (b . (c . nil)))
beach has quit [Ping timeout: 240 seconds]
ltriant has quit [Quit: leaving]
<tsizz> aeth: hm i tried to
<tsizz> iterate a list
<tsizz> with recursion
<tsizz> but i can't use base case as nil or '()
<aeth> that should work
<tsizz> aeth: i tested for null using (number? (list-ref list index)
<aeth> tsizz: you should ask that question in #racket because it looks like a Racket question
<tsizz> aeth: oh i was just testing for nil wrong
<tsizz> or doing base case wrnog
<aeth> tsizz: null isn't a number, it's the empty list. It's tested with null? in Racket and null or endp in Common Lisp
<tsizz> aeth: ah gotcha
<tsizz> thats what i was missing haa
<tsizz> aeth: oh but im still getting out of index error
pjb has quit [Remote host closed the connection]
<tsizz> bc i thought nil would be index of the number of elements in the list
<tsizz> i.e. '(1 2 3 4 '())
<tsizz> so index 4
<tsizz> but guess not..
<aeth> tsizz: When you iterate through a list, you start with '(a b c) then work on '(b c) then work on '(c) then work on '() updating with the cdr each time
pjb has joined #lisp
<tsizz> aeth: ah okay ill try it thanks
<verisimilitude> The end of a list being NIL is just a sentinel value, tsizz. There are some nice qualities that come about when the empty list is also the ending of a list.
<verisimilitude> In Common Lisp, it's also the only false value; this is very convenient for manipulating lists.
<aeth> tsizz: similarly you don't have '(1 2 3 4 '()) you have '(1 2 3 4) but iterating through it gives you '(1 2 3 4) then '(2 3 4) and eventually '() when no elements are left
libertyprime has quit [Quit: leaving]
<aeth> and this is because the last cdr is nil
<aeth> tsizz: you're essentially moving through sublists because every list has a list as its cdr (which wouldn't be the case if lists didn't end in nil, btw)
<tsizz> aeth: do i have to parse list..?
<tsizz> saying '(4) is not a number so i can't sum it
<aeth> tsizz: when you're iterating through a list, you normally care about the car and the cdr
<tsizz> verisimilitude: hm interesting thanks
corvidzz_ has joined #lisp
<aeth> tsizz: you're not iterating through values (unless you use something like map) you're iterating through sublists, so you have to take the car
<tsizz> aeth: oh okay i got it
<tsizz> pseudocode
<tsizz> basically just did (+ (car list) (function (cdr list)))
<tsizz> for recursive call and base case just check for null and return 0
<tsizz> for summing a list together
<aeth> I think that that will work but it's not tail recursive because the tail call is + not the function itself.
<aeth> If you wanted it to be tail recursive you would have to build the value in another argument to make sure that the function's tail call is the function itself.
<tsizz> aeth: hm true and i should do tail recursion
<tsizz> should i do tail recursion?
<aeth> If you do recursion and can do tail recursion, yes, you should try to do tail recursion. In Common Lisp, it's rarer than Scheme because the optimization is not guaranteed.
<aeth> (It will be optimized in many CL implementations, though)
corvidzz_ has quit [Quit: Lost terminal]
<tsizz> aeth: i can't think of how to do it
<Jachy> tsizz: You might want to go through the first chapter of this book It's for scheme, but most of the lessons will carry back to common lisp.
<aeth> tsizz: you have to pass it through and build it up through each iteration just like you're doing with the sublist. Except your answer is growing as the sublist is shrinking
<aeth> tsizz: so (f (cdr list) (+ (car list) result)) and then at the end return result instead of 0
<aeth> that then (probably) makes f the tail call
<tsizz> okay
<tsizz> yeah i think i did that
<tsizz> if null return sum
vlatkoB has joined #lisp
<tsizz> else (doAddition (cdr list) (+ sum (car list)))
<tsizz> so thats better recursion
<aeth> it can be more efficient.
<tsizz> hmm okay
<tsizz> aeth: alright thanks a lot for the help im gonna go to sleep
makomo has joined #lisp
<tsizz> Jachy: alright thanks too
<tsizz> good night
tsizz has quit [Quit: Page closed]
<aeth> If you don't want the recursion, the do macro is equivalent to (a subset) of this sort of iteration in Scheme and near-equivalent (the edge case involves making closures) in Common Lisp.
<aeth> Answering in two languages simultaneously is difficult.
nicdev has quit [Remote host closed the connection]
nicdev has joined #lisp
runejuhl has joined #lisp
JohnMS_WORK has joined #lisp
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
<splittist> morning
angavrilov has joined #lisp
akssri has joined #lisp
akssri has quit [Remote host closed the connection]
gxt has quit [Ping timeout: 268 seconds]
longshi has joined #lisp
Krystof has quit [Ping timeout: 245 seconds]
nicdev has quit [Write error: Connection reset by peer]
Grue` has left #lisp ["Changed major mode"]
flazh has quit [Ping timeout: 245 seconds]
flazh has joined #lisp
longshi has quit [Quit: WeeChat 2.4]
rumbler31 has joined #lisp
scymtym has quit [Ping timeout: 255 seconds]
rumbler31 has quit [Ping timeout: 250 seconds]
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
<splittist> I love the way search engines correct my searches for 'plump lisp'. Now I want to start a project called Botox.
<flip214> for me shinmera comes up first... but yes, there's a "did you mean"
<flip214> oh, the old times... "shall PIRNT be PRINT?"
<aeth> Search engines are just so bad now.
<aeth> At least for programming.
scymtym has joined #lisp
<aeth> They're better at being Ask Jeeves than Ask Jeeves ever was, but I don't want to ask natural language questions. I want to query specific terms that might be very niche.
<flip214> it's not that bad for lisp... but try googling for perl operators ;/
<aeth> Oh, it's not bad, it's just worse than 10 years ago, and worse than 1 year ago.
<aeth> s/not bad/not *that* bad/
<aeth> CL does have some stuff that are hard to search. e.g.
<aeth> If CL wasn't so niche it'd probably be very searchable because of its anti-symbolic naming conventions (except for arithmetic).
nowhere_man has quit [Ping timeout: 259 seconds]
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
varjag has joined #lisp
cmatei has quit [Remote host closed the connection]
<flip214> aeth: well, if you _know_ you're looking at standard CL stuff just bookmark and be done ...
<flip214> for other things there's quickdocs -- and whatever happened to CLUS, BTW?
nowhere_man has joined #lisp
<aeth> flip214: I just tend to do !l1sp in duckduckgo
caltelt_ has joined #lisp
schweers has joined #lisp
hhdave_ has joined #lisp
p9fn has quit [Ping timeout: 250 seconds]
nanoz has quit [Ping timeout: 245 seconds]
heisig has joined #lisp
ykm has joined #lisp
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
xristos has quit [Ping timeout: 250 seconds]
plugd has joined #lisp
caltelt_ has quit [Ping timeout: 268 seconds]
ym555_ has joined #lisp
ykm has quit [Remote host closed the connection]
selwyn has joined #lisp
bobby has quit [Ping timeout: 245 seconds]
bobby has joined #lisp
m00natic has joined #lisp
igemnace has quit [Quit: WeeChat 2.4]
Bob- has joined #lisp
bobby has quit [Ping timeout: 258 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
nowhere_man has quit [Ping timeout: 250 seconds]
dimpase_ has quit [Ping timeout: 245 seconds]
talx has joined #lisp
<talx> skill programming of cadance
<talx> is part of lisp ?
ebrasca has joined #lisp
<schweers> talx: in case you mean, it is /a/ lisp dialect. This channel is dedicated to Common Lisp.
amerlyq has joined #lisp
<runejuhl> oh wow, it's not often you see SKILL referenced
<schweers> I have never heard of it, had to consult a search engine.
<talx> :(
<schweers> talx: no need to be sad. Common Lisp is around today and is a very good language with good, free implementations available.
<schweers> at least if you use unix ...
<talx> costumer want me to use skill though
vlatkoB_ has joined #lisp
<runejuhl> I've only worked with it for a bit of debugging, and I'm happy for that.. just the idea of a `]` operator that closes all open braces gives me pain
<schweers> runejuhl: please tell me that is a joke
ym555_ has quit [Ping timeout: 250 seconds]
<runejuhl> schweers: sadly no
okeg has joined #lisp
<schweers> It seems for every good idea humanity has, 10 more bad ones enter the world :D
<schweers> In case someone wants to accuse me of arrogance: I’m sure I’ve uttered my fair share of bad ideas.
vlatkoB has quit [Ping timeout: 255 seconds]
<runejuhl> schweers: "In the second example, the "super right bracket." This simple device automatically enters enough right parentheses to correctly complete the current expression (in this case the procedure definition)."
<runejuhl> schweers: from SKILL: A CAD System Extension Language, 1990,
<schweers> dear god, don’t these people have text editors?
<schweers> hehe, they have a language called GPL
Achylles has joined #lisp
<schweers> that doesn’t look like lisp to me. looks pretty algol like
<runejuhl> nah, they just moved the first form outside the parens
* schweers sighs
gareppa has joined #lisp
* schweers gets back to writing Common Lisp code) :
* schweers has to teach spacemacs not to move parens around in ERC.
<runejuhl> sounds like you have paredit enabled in not just prog-mode but also text-mode?
gareppa has quit [Remote host closed the connection]
<schweers> smartparens, I guess. It must be something like that.
jmercouris has joined #lisp
Lord_of_Life has quit [Ping timeout: 250 seconds]
mindthelion has quit [Remote host closed the connection]
mindthelion has joined #lisp
Lord_of_Life has joined #lisp
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #lisp
jsjolen has joined #lisp
<jsjolen> Huh, my SLIME doesn't indent a macro's &body argument correctly :-/.
<phoe> jsjolen: do you have slime-indentation installed in emacs?
<jsjolen> phoe: Not as far as I know. But I also don't know how to check. I installed slime through ql's slime helper
<heisig> jsjolen: Have you already evaluated the macro definition, and are you in a package where this definition is visible?
<jsjolen> heisig: Yes! SLIME auto-completes it and everything
<phoe> jsjolen: fire up IELM. What is the value of slime-contribs?
<jsjolen> I just did (require 'slime-cl-indent)
<jsjolen> phoe: (slime-fancy)
<phoe> jsjolen: (slime-company slime-asdf slime-fancy slime-indentation slime-sbcl-exts slime-scratch)
<phoe> that's my contribs
<heisig> jsjolen: And you use &body, and not accidentally &rest?
<jsjolen> heisig: I am (it's actually the cl-a-d-t:match macro)
<phoe> jsjolen: add slime-indentation to your contribs, that should help.
<jsjolen> phoe: Yeah, I'm gonna restart SLIME and see if there's a diff.
<jsjolen> Well, still got the issue. IT works with other macros though, it's just adt:match tha tfails.
<heisig> jsjolen: Odd. My last, desperate guess: Is there a compiler macro of the same name present?
<jsjolen> heisig: Nope! C-M-F 'adt:match returns NIL
scymtym has quit [Ping timeout: 268 seconds]
Bike has joined #lisp
dddddd has joined #lisp
esrse has quit [Ping timeout: 250 seconds]
warweasle has joined #lisp
<phoe> jsjolen: which package is your REPL in?
<phoe> can you (in-package :adt) and try again?
<jsjolen> phoe: Still doesn't work, but I'm not 100% sure if slime-indentation is on.
<phoe> jsjolen: have you run slime-setup with the new contribs?
<jsjolen> phoe: Nope! I didn't know that was a thing
ym555_ has joined #lisp
<jsjolen> Just did that in IELM, same results
<phoe> hmmm
<jsjolen> It's not a massive issue :-).
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
<phoe> but I know how annoying it can be
<phoe> does slime suggest the lambda list for the macro when you edit it?
pankajgodbole has joined #lisp
<jsjolen> phoe: Yup, and it's a &body parameter
talx has quit [Ping timeout: 255 seconds]
<jackdaniel> if anyone have some spare time in their hands I'd appreciate critical remarks on this mailbox implementation:
jmercouris has quit [Ping timeout: 245 seconds]
nowhere_man has joined #lisp
sjl_ has joined #lisp
<phoe> jackdaniel: the loop on L43 is just copy-list, isn't it?
<jackdaniel> phoe: no, messages-tail have one more element
<jackdaniel> to allow fast append
<phoe> ooh, I see - this copies without the last element
<phoe> jackdaniel: s/producent/producer/g
<jackdaniel> right, thanks
jmercouris has joined #lisp
<jmercouris> how can I open slime without it messing with all of my windows?
<minion> jmercouris, memo from jasom: don't use csh
<jmercouris> lol, nice
<jmercouris> jasom: why not?
<gilberth> As a matter of taste: I do not like the business on lines 81 and 82. Why not (min (mailbox-%count mailbox) (or n (mailbox-%count mailbox)))?
<gilberth> And then the ZEROP test could be skipped. When 'n' is zero the LOOP would return NIL as well.
<phoe> I'd also abstain from modifying the function argument and introduce a new binding instead - again, matter of taste and a little bit of debuggability
<jackdaniel> thank you, I like it
<jackdaniel> (regarding min business)
<makomo> hmm, what's a "locative"?
<phoe> an object at the end of the list so you can do fast tail-nconcing
<gilberth> When you keep the UNLESS, why not pull it above the WITH-LOCK-HELD?
<jackdaniel> locatives are first-class pointers, I emulate it with cons
<gilberth> Forget it, stupid idea.
<jackdaniel> gilberth: in principle count could increase between this call and the lock
<gilberth> Sure. It's late for me.
<makomo> ah, right, now i remembered stylewarning's cl-locatives
<makomo> any idea who coined the term?
Achylles has quit [Remote host closed the connection]
<makomo> not so easy to google it seems
nowhere_man has quit [Ping timeout: 250 seconds]
<phoe> AFAIK it was used in older Lisp systems where locatives were first-class by default
<makomo> jackdaniel: (setf (car/cdr ...)) instead of rplaca/rplacd maybe?
<jmercouris> first-class pointers???
<phoe> yes, something like that
<phoe> first-class places, rather
wilfredh has joined #lisp
gxt has joined #lisp
<hjudt_> what is the best way to concatenate pathnames, or better a pathname and a string? e.g. i want to concat "~/my/path/" "to/this/file"?
<hjudt_> where #P"~/my/path/" already is a pathname
<phoe> merge-pathnames
<phoe> (merge-pathnames #p"foo/" #p"/bar/") ;=> #P"/bar/foo/"
jsjolen has quit [Remote host closed the connection]
<hjudt_> right, it really is that easy. slime's docstring help confused me...
<hjudt_> thanks
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
notzmv has quit [Remote host closed the connection]
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
nanoz has joined #lisp
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
lumm has joined #lisp
jeosol_ has quit [Ping timeout: 256 seconds]
pjb has quit [Remote host closed the connection]
Ukari has quit [Remote host closed the connection]
pjb has joined #lisp
Ukari has joined #lisp
angavrilov has quit [Remote host closed the connection]
Inline has joined #lisp
Achylles has joined #lisp
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
rippa has joined #lisp
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
igemnace has joined #lisp
pjb has quit [Remote host closed the connection]
lucasb has joined #lisp
<verisimilitude> The HyperSpec is a good resource to use whenever you're confused, hjudt_.
<verisimilitude> You can also use MAKE-PATHNAME with the :DEFAULTS argument being set as necessary.
pjb has joined #lisp
nowhere_man has joined #lisp
pjb has quit [Remote host closed the connection]
Ukari has quit [Remote host closed the connection]
pjb has joined #lisp
Ukari has joined #lisp
heisig has quit [Quit: Leaving]
Ukari has quit [Ping timeout: 250 seconds]
amerlyq has quit [Quit: amerlyq]
lumm has quit [Quit: lumm]
nowhere_man has quit [Read error: Connection reset by peer]
lumm has joined #lisp
nowhere_man has joined #lisp
lumm has quit [Client Quit]
lumm has joined #lisp
Ukari has joined #lisp
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
catchme has joined #lisp
<catchme> Hello
nullheroes has quit [Quit: WeeChat 2.3]
jmercouris has quit [Ping timeout: 246 seconds]
<catchme> How to call C-function by pointer from dll?
<catchme> They require that I know the function symol, but I want to pass the pointer and args type without the symbol name
plugd has quit [Ping timeout: 246 seconds]
<catchme> As I understood from the example `(foreign-funcall-pointer (foreign-symbol-pointer "abs") () :int -42 :int)` the pointer doesn't mean the function pointer!
<_death> what does it mean then?
<catchme> string pointer!
<_death> how did you arrive at this conclusion?
<catchme> uh,... oh. You are right thanks alot :) I misunderstood "foreign-symbol-pointer"
<_death> ;)
panji has joined #lisp
jmercouris has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
Ukari has quit [Ping timeout: 255 seconds]
LiamH has joined #lisp
amerlyq has joined #lisp
<pjb> yep.
Essadon has joined #lisp
Essadon has quit [Max SendQ exceeded]
Essadon has joined #lisp
Ukari has joined #lisp
Essadon has quit [Client Quit]
akoana has joined #lisp
warweasle has quit [Quit: brb]
varjag has joined #lisp
myrkraverk has joined #lisp
rumbler31 has joined #lisp
<phoe> Shit.
<phoe> Shit, shit, shit, shit.
ckonstanski has quit [Quit: bye]
<phoe> I must miss this year's ELS and tend to my bronchitis and pneumonia instead.
<phoe> Sorry, everyone.
rumbler31 has quit [Ping timeout: 268 seconds]
<Bike> feel better.
<phoe> I will try to.
nowhere_man has quit [Ping timeout: 250 seconds]
<pjb> Yeah, better not to contaminate all the lispers of the world (or almost).
JohnMS_WORK has quit [Quit: KVIrc 4.2.0 Equilibrium]
warweasle has joined #lisp
mathrick has quit [Ping timeout: 252 seconds]
<grewal> If you wanted hygiene, you should have stuck to scheme.
<pjb> :-)
Achylles has quit [Remote host closed the connection]
Achylles has joined #lisp
Grue` has joined #lisp
<schweers> I hope you recover quickly, phoe!
<phoe> grewal: that hurt
<phoe> schweers: thanks. I'll do my best.
mathrick has joined #lisp
gxt has quit [Ping timeout: 272 seconds]
<verisimilitude> On the topic of csh:
<verisimilitude> !xxx%s%s%s%s%s%s%s%s
<verisimilitude> I wonder if this will still crash it.
<verisimilitude> Perhaps they wanted to fix this bug, but couldn't, because some programs have grown to depend on this useful behavior?
<jmercouris> on the topic of CSH, not exactly a fun one is it?
<jmercouris> I haven't seen much love for it here, or anywhere really :D
<verisimilitude> Power tools for power fools.
<grewal> At my last job, csh (or rather tcsh) was still the "official" shell according to all the documentation. Of course, all actual shell scripts started with #!/usr/bin/bash
hhdave_ has quit [Ping timeout: 250 seconds]
ym555_ has quit [Quit: leaving...]
nanoz has quit [Ping timeout: 255 seconds]
ym555 has joined #lisp
MichaelRaskin has joined #lisp
schweers has quit [Ping timeout: 240 seconds]
<makomo> phoe: sad to hear that, but take care and get better :-)
terpri has quit [Remote host closed the connection]
bjorkintosh has quit [Remote host closed the connection]
lionrouge has joined #lisp
<lionrouge> hi !
<phoe> hey lionrouge
<lionrouge> what is the fastest LISP dialect now? I mean suitable to write a scientific calculation program
zotan has quit [Ping timeout: 268 seconds]
<phoe> hard to say
<phoe> because #lisp is for Common Lisp
<phoe> so answers may be skewed towards that dialect
<lionrouge> maybe there are libraries to do the task like NumPy/SciPy/etc. in Python which itself is pretty slow
<phoe> but, if you want Common Lisp, SBCL is pretty damn fast when it comes to optimizing numeric computation
<phoe> since it compiles to machine code and optimizes decently
selwyn has quit [Remote host closed the connection]
<lionrouge> phoe: I remember SBCL is compiled, is that true?
<lionrouge> I see
zotan has joined #lisp
<phoe> lionrouge: yes, it's a compiler
<phoe> it also has an interpreter, but it isn't used often
<verisimilitude> Unlike Python, it's common to write Common Lisp libraries in Common Lisp, or at least that's the ideal.
<lionrouge> When I heard it's name for the first time I thought there was some Steel Bank and it created a LISP dialect for it's own internal purposes and only recently I discovered true history of the name :)
<phoe> lionrouge: the story of SBCL name is actually funny
<phoe> SBCL came from CMU CL which is Carnegie Mellon University CL
<phoe> at that university, Carnegie was a professor of steelworking and Mellon was a professor of banking
pierpal has quit [Quit: Poof]
<phoe> (if I got some details wrong, somebody please correct me)
<phoe> so that's how CMU got turned into SB
<lionrouge> does it have any repository of libraries similar to pypi, npm?
pierpal has joined #lisp
<verisimilitude> That's right by my understanding, phoe.
<phoe> lionrouge: yes, quicklisp
<phoe> though quicklisp works across implementations, it is not SBCL-specific
<lionrouge> Ok
<verisimilitude> It's important to note that Quicklisp isn't standardized, lionrouge.
<dlowe> That Guy Steele was a co-designer of CL is probably just a coincidence
<verisimilitude> Common Lisp has no standard package manager, but Quicklisp is an offering.
<phoe> npm isn't standard either
<lionrouge> I think none of such repos are standard
<lionrouge> I mean they are not described in language technical docs
<phoe> quicklisp is the de-facto standard for getting Lisp libraries nowadays.
<verisimilitude> Rust, however poor, is an example of a language with a rather standard package manager.
<grewal> phoe: Carnegie and Mellon weren't professors. They made their money in steel and banking, and then founded the university
<phoe> grewal: thanks!
<verisimilitude> Well, I'd thought ``professor'' could be used to show support of something, making phoe roughly right despite the phrasing, but that meaning only applies when concerning religion, after checking my dictionary.
<phoe> lionrouge: ^
<verisimilitude> So, you can be a Baptist professor, but not a steel professor.
<verisimilitude> Not in that sense, anyway.
<grewal> I've never heard the word professor used that way before. good to know
<TMA> universities are rarely named after academics -- there are exceptions, but then the named academic was already dead by the time the university was founded
<dlowe> no, no. "Professor" is only a teacher in English. "to profess" is a different thing.
<grewal> professor 1. One who professed, or makes open declaration of, his
<grewal> sentiments or opinions
<dlowe> "Professor" meaning "someone who professes" is hilariously archaic
<Bike> i uh, thought phoe was making a funny
<verisimilitude> So, dlowe?
<grewal> Perhaps I should start reading more modern books...
<phoe> Bike: I wasn't, I was making a stupid
<Bike> oh
<Bike> because carnegie mellon university as an entity didn't exist until both the actual people died, i think
<verisimilitude> My Oxford dictionary only uses that meaning for religion, but it does make sense that it would apply to the other meanings, I thought. Which dictionary is that, dlowe?
<Bike> wiktionary has it, and has a quote about professors of magic, which is sort of not a religion
hiroaki has joined #lisp
<verisimilitude> That's good to know.
<grewal> Wicca is a religion. So is Jedi
<verisimilitude> So, your original phrasing was correct, phoe.
<verisimilitude> It's confusing unless you already know, but that's an aside.
<dlowe> As an educated native speaker, I would never ever abscribe that meaning unless I was reading something old.
<grewal> They weren't professors in either sense, though
* dlowe shrugs.
<verisimilitude> I'm also a native speaker; you're not a prescriptivist, are you, dlowe?
<dlowe> verisimilitude: if I were I would say the dictionary is always correct, no?
<verisimilitude> Yes.
<Bike> using cognates like that is a pretty common thing for speaking a learned language, there's no especial problem
<verisimilitude> I am; descriptivism is stupidity.
<dlowe> and here I am saying the dictionary is wrong
<dlowe> so....
<dlowe> well, not wrong.
<grewal> But in English, descriptivism is the only way to go
<dlowe> overly complete and without nuance
<grewal> There's no formal body controlling the language.
<verisimilitude> Don't be misled by such nonsense, grewal.
<verisimilitude> If people misuse the language and that's allowed without complaint, such cretins destroy the language over time.
<grewal> Language is a tool. It's only as useful insofar as you understand what I'm saying
<verisimilitude> Yes, which is why having rigid meanings is important.
<Bike> i contributed myself, but this is kind of off topic...
<dlowe> verisimilitude: your sarcasm is just making you look inconsistent
<verisimilitude> I'm not being sarcastic.
<dlowe> right, steel bank
<grewal> p] lionrouge: Is there any particular reason you want to use lisp for scientific work?
Josh_2 has quit [Remote host closed the connection]
<verisimilitude> Tying this to Common Lisp, I expect every implementation to follow the standard, and if it doesn't, then it's broken and I won't ``correct'' my program to work on it, even if it were a trivial change.
<grewal> Sure, but natural language is more like pseudocode than code. It adheres to a "metalanguage" rather than to a formal spec.
<grewal> And what about if you had a working lisp program in Lisp 1.5 or Interlisp or something, you wouldn't ``correct'' it to work on Common Lisp?
<verisimilitude> Those are different dialects, really different languages entirely.
<verisimilitude> Still, Common Lisp was designed to be the common dialect and so contains many things those others had to ease this.
<verisimilitude> So, it's more translation than correction, I'd think.
sauvin has quit [Remote host closed the connection]
<grewal> At what point do we say no more change? Should we go back to Old English or Latin? Should we drop modern languages and program everything in assembly? (N.B. I not making an analogy between Latin and assembly)
<verisimilitude> I'd certainly prefer to use a singular ``they'' and also ``thou'' instead of the ambiguous ``you''.
<verisimilitude> If the machine is high-level, why not program in its native language, grewal?
<grewal> You just need to adopt y'all and all y'all.
<grewal> Touche
kajo has joined #lisp
m00natic has quit [Remote host closed the connection]
<lionrouge> grewal: I'm an FPGA designer and my father is a physicist with some bright ideas on simulating physical processes which he implemented in Fortran in late 80s in his thesis. He wants to continue this work and I want to help. However I don't want to use C for it (I know it well, I do highload programs for PC and embedded and I know how easy it is to mess up and how hard it is to change program architecture once it's even a bit mature)
<lionrouge> Also I know Python and Go, trying to study Clojure as I got interested in FP in recent couple of years.
<lionrouge> Reading some papers by Sussman just makes me feel LISPs are superior for this kind of work
<lionrouge> especially in prototyping stage
<verisimilitude> Lisp is a particularly good language if you only have a vague idea of what you're doing, lionrouge.
pankajgodbole has quit [Ping timeout: 246 seconds]
<MichaelRaskin> Another case is when you are willing to invest into making language constructs to express the computation
terpri has joined #lisp
irdr has quit [Remote host closed the connection]
irdr has joined #lisp
<grewal> And a nice thing with Common Lisp (and possibly other dialects) is that you can optimize only what needs to be optimized
Josh_2 has joined #lisp
<grewal> And don't forget that you can use ffi to communicate with any existing fortran and C libraries that you don't want to reimplement
<lionrouge> grewal: that's a plus definitely
jmercouris has quit [Remote host closed the connection]
vlatkoB_ has quit [Remote host closed the connection]
aeth has quit [Read error: Connection reset by peer]
lionrouge has quit [Quit: Page closed]
aeth has joined #lisp
<p_l> Can we have next ELS in a...flatter city?
panji has left #lisp [#lisp]
q9929t has joined #lisp
<flip214> p_l: are you already there?
gareppa has joined #lisp
<flip214> and last year's venue wasn't really horizontally all around
gareppa has quit [Client Quit]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
tharugrim has joined #lisp
<p_l> Already there, and yes, last year's wasn't flat either, but Genova is even more hilly
verisimilitude has quit [Remote host closed the connection]
<phoe> (setf (terrain-elevation (els 2020)) 0.0)
<phoe> p_l: done
<_death> (flatten '(g e n o (v) a))
aindilis has quit [Read error: Connection reset by peer]
<phoe> _death: I laughed
<_death> phoe: hope to see you next year
<phoe> _death: will do my best
rumbler31 has joined #lisp
rumbler31 has quit [Remote host closed the connection]
<pjb> phoe: Un professeur is a French teacher too!
<pjb> phoe: Mais un professeur enseigne, alors qu'un croyant professe!
gxt has joined #lisp
<pjb> p_l: do you mean there's no elevator in the hotel?
<p_l> No, it's just hilly and I did a lot walking up today
tsizz has joined #lisp
<tsizz> my test was sorta dumb lol. it was more understanding the language than concepts
Achylles has quit [Remote host closed the connection]
<p_l> I walked up with my GF from sea level to the mountain forts
Josh_2 has quit [Quit: ERC (IRC client for Emacs 26.1)]
verisimilitude has joined #lisp
Quasus has joined #lisp
verisimilitude has quit [Remote host closed the connection]
rumbler31 has joined #lisp
Fare has joined #lisp
scymtym has joined #lisp
Krystof has joined #lisp
tEsTNAmE has joined #lisp
q3d has joined #lisp
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
p9fn has joined #lisp
libertyprime has joined #lisp
runejuhl has quit [Ping timeout: 250 seconds]
Aruseus has joined #lisp
tEsTNAmE has quit [Remote host closed the connection]
klltkr has quit [Quit: Leaving]
Younder has quit [Remote host closed the connection]
tEsTNAmE has joined #lisp
runejuhl has joined #lisp
tEsTNAmE has quit [Remote host closed the connection]
klltkr has joined #lisp
MichaelRaskin has quit [Ping timeout: 246 seconds]
ebrasca has quit [Remote host closed the connection]
mindthelion has quit [Ping timeout: 250 seconds]
<seok> Morning, 8.20am Sunny day in Sydney
myrkraverk has quit [Ping timeout: 255 seconds]
<aeth> It's already Sunday in Sydney?
lyf[kde] has joined #lisp
lyf[kde] has quit [Remote host closed the connection]
amerlyq has quit [Quit: amerlyq]
Fare has quit [Ping timeout: 255 seconds]
igemnace has quit [Quit: WeeChat 2.4]
xristos has joined #lisp
xristos has quit [Remote host closed the connection]
xristos has joined #lisp
myrkraverk has joined #lisp
caltelt_ has joined #lisp
<no-defun-allowed> aeth: sunny day /= sunday
<no-defun-allowed> though it is only cloudy here, bit of a change
Khisanth has quit [Ping timeout: 268 seconds]
sjl_ has quit [Ping timeout: 244 seconds]
rumbler31 has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 255 seconds]
Bike has quit []
moei has quit [Quit: Leaving...]
ltriant has joined #lisp
Khisanth has joined #lisp
myrkraverk has quit [Ping timeout: 246 seconds]
ltriant has quit [Ping timeout: 268 seconds]
jack_rabbit has quit [Ping timeout: 250 seconds]
ltriant has joined #lisp
myrkraverk has joined #lisp
<seok> Why am I able to clackup 2 different applications on a single REPL?
<pjb> What does clackup mean?
<seok> I'd imagine there would be issues running 2 servers on single thread
<seok> clack is a web server
<pjb> Who said there was only a single thread?
<phoe> not if it has an event loop of sorts or if it is multithreaded
<seok> Well clack uses hunchentoot as default
<seok> If I clackup twice, does clack use 2 different threads?
<phoe> yes
<phoe> clack seems to use a thread for each app
<seok> Nice
<sjl> It has a :use-thread key arg that defaults to t if threads are supported, so my guess would be "yes"
myrkraverk has quit [Ping timeout: 250 seconds]
Quasus has quit [Ping timeout: 272 seconds]
tsizz has quit [Ping timeout: 256 seconds]
LiamH has left #lisp [#lisp]
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 246 seconds]
wxie has joined #lisp
Bike has joined #lisp
jack_rabbit has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
wxie has quit [Ping timeout: 250 seconds]
varjag has quit [Ping timeout: 250 seconds]
myrkraverk has joined #lisp
ltriant has quit [Ping timeout: 250 seconds]
<seok> Well, after a day of fiddling with various server and web libraries, I think I am ready to build a simple webgame app
<seok> *congratulates self*
torbo has joined #lisp
jack_rabbit has quit [Ping timeout: 245 seconds]
lumm has quit [Quit: lumm]
nicdev has joined #lisp
<ioa> Sorry to hear you're not coming to the ELS, phoe. I hope you get well soon.
<ioa> I will be wearing the tag you made me last year. :)
myrkraverk has quit [Ping timeout: 250 seconds]
<ioa> _death, happy you'll be there too!
hiroaki has quit [Ping timeout: 245 seconds]
ltriant has joined #lisp
<seok> Hm.. How do I use multiple files for a single package for a quickproject package?
<seok> I put the file in :components (:file "filename")
<pjb> Just put (in-package "YOUR-PACKAGE") at the start of each file.
<pjb> :components ((:file "source1" :depends-on ("package")) (:file "source2" :depends-on ("package")) …)
<pjb> the file package.lisp defines the package.
<seok> Hm.. still not getting the other file
<seok> Seems like what Ive done
<pjb> Do you meamn that you have a dependenciy between your files?
<pjb> :components ((:file "source1" :depends-on ("package")) (:file "source2" :depends-on ("package" "source1")) …) <- add it!
<seok> No, I am just testing with (defparameter x 50)
<seok> x is still unbound on REPL
<pjb> Well, here is your error: you didn't use the stars in a special variable name!
nanoz has joined #lisp
<pjb> and it's not x, it's your-package::*x*
<seok> pjb: Ah Silly mistake
<seok> Feels so bad
<pjb> You an also (in-package "YOUR-PACKAGE") in the REPL.
<seok> Ya,
<seok> Ive been too focused on this separate file thing
<pjb> or use com.informatimago.common-lisp.interactive.interactive:pushp and popp
<seok> forgot to in-package in REPL
<seok> :((
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
<seok> TY brother
<pjb> yw
lerax has joined #lisp
<lerax> Someone here uses next browser?
<seok> Coming from python I cant get used to earmuffs
<pjb> You have to, or else you will lose days in debuggign.
<lerax> I have a doubt about how I can fix the giant status mini-buffer.
<seok> lerax: I could never get it running on my windows
<seok> I really want it though
<seok> It would save me days of coding trying to figures out puppeteer + chrome api for scraping
<seok> pjb: Will anyone frown at me for using just one star?
<pjb> yes.
<seok> :)
<seok> Whyy
<pjb> This convention is quite strong.
<pjb> Single stars are used as a prime. eg. you can have a function f and f*
<seok> What about *f?
<pjb> Sometimes, you define a macro foo, and it calls a function foo*
<pjb> *f is not used often, you could use it, but for special variable the convention is *foo*.
<lerax> seok:ah ok, sbcl has bad windows support, sorry to hear that.
<pjb> and for constants, +foo+
<lerax> seok: seems that the main developer uses macOS too, initially didn't even work on Linux
<seok> lerax: Its one of the dependencies on NeXT that is hard to install, if not impossible on windows
<seok> Don't think its SBCL thats the problem
<lerax> seok: yeah, totally, some stuff related to cocoa, webkit and stuff.
<seok> Think it was webkit
<lerax> I understand
<lerax> webkit is a hell.
<seok> :(
<lerax> At once I tried to compile myself
<lerax> Take two days and didn't finished
<lerax> webkit of qt
<seok> pjb: Guess I work on habituation
<lerax> (on Linux)
aindilis has joined #lisp
<lerax> I don't use Windows currently... actually it past some years since the last time I used
<lerax> Well, exwm + next it's a nice combination
<lerax> I was trying to fix some stuff here
<seok> Well, the options for scraping JS based content atm is Selenium (outdated library on CL), PhantomJS (discontinued) or puppeteer
<seok> Since I can't get NeXT working
<lerax> Good to see your feedback, seok. Sorry to hear that you cannot tried in Windows. NeXT it's really a nice browser.