Xach changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/>
slyrus__ has joined #lisp
<aeth> asarch: Just like there's probably some arithmetic (with floats, perhaps?) where our ideal arithmetic model breaks down, there are some edge cases where the latter model with QUOTE breaks down. A quoted list is a literal list, which means you should treat it as immutable by convention. Then you avoid these edge cases.
<asarch> Ok
<aeth> and, yes, it breaks down with some floats, e.g. (let ((a 0.1) (b 0.2) (c 0.3)) (= (* a (+ b c)) (+ (* a b) (* a c))))
<pjb> then use ratios.
<pjb> (let ((a 1/10) (b 2/10) (c 3/10)) (= (* a (+ b c)) (+ (* a b) (* a c)))) #| --> t |#
<aeth> pjb: My point was to point out that the Platonic ideal of Distributive Law breaks down in practice, with my arithmetic example (that everyone should know, even though the s-expression syntax might be unfamiliar) and with the quote example.
slyrus_ has quit [Ping timeout: 268 seconds]
<asarch> If I do: (quote ("lisp" "simply" "rocks")) then it would create a list of STRINGS, right? Now, if I just do (quote (lisp simply rocks!)), what would LISP, SIMPLY and ROCK! be?
<aeth> asarch: symbols
<asarch> Symbols?
<aeth> asarch: Symbols are special objects that are created by upcased strings (upcased unless your reader is fancy, or you make them literal like '|foo| is). They have some other properties attached to them, like that they're namespaced within packages and they have a symbol plist (no one uses the latter)
<pjb> DUH
<aeth> asarch: the important thing is that (eq 'foo 'foo) => T
<aeth> (eq "foo" "foo") => ? probably NIL, but not necessarily, since the '"' in "foo" means it's literal, so implementations can do some magic there if they choose afaik
minion has quit [Remote host closed the connection]
<asarch> Then, for the sake of the reason, I would consider that Common Lisp data types are: symbols, string, integers, ratios and float, right?
minion has joined #lisp
<no-defun-allowed> aeth: FWIW, I've had SBCL mess with constant strings quite often when invoking compile-file.
<no-defun-allowed> https://sellout.github.io/media/CL-type-hierarchy.png is a graph of all the types in Common Lisp.
<aeth> asarch: the best overview I can find at the moment is unfortunately CLtL2, which is outdated: https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node15.html
<aeth> the bullet points at the bottom there
<asarch> WOW!!!
<aeth> asarch: you can look at the hyperspec's index to sort of get the same feeling but up-to-date. http://www.lispworks.com/documentation/HyperSpec/Front/Contents.htm
v_m_v has quit [Ping timeout: 240 seconds]
<aeth> but you'll just see e.g. "numbers", not the subtypes of number
<aeth> asarch: this is possibly the most up to date, and includes the MOP, not just the stuff in the base standard. https://sellout.github.io/media/CL-type-hierarchy.png
<aeth> (I have seen that around the Internet, that just happens to be the top result on DDG image search at the moment)
<aeth> What might be hard to read from that graph is that everything is a T, nothing is a NIL, and anything that's not a CONS is an ATOM. Everything else on that should be straightforward.
<asarch> Wow! So one could not simply "uninstall" MOP and then use another OOP service as a replace, right?
<aeth> Well, two things. (1) MOP doesn't have to be there for it to be standard CL because it's an extension and (2) CL itself has at least three built-in "object systems" of sorts. The condition system is technically independent (it's usually implemented via CLOS for convenience, but not in CL) and there's also the DEFSTRUCT structure-class system
<aeth> The latter is part of the MOP hierarchy in that graph, but in practice it's quite distinct from the other forms of OOP (except for that you can define a DEFMETHOD that works on structure-classes) because it predates CLOS
<aeth> s/but not in CL/but not in SBCL/
<aeth> oops
<aeth> asarch: And you can, of course, use macros and reader macros to use whatever paradigm you want (including your own OOP one), but writing your own OOP system means limited interoperability with everyone else's code so it's probably best to try to implement it via MOP if possible.
<asarch> Yeah, yeah. "Don't duplicate bugs" :-)
smazga has quit [Quit: leaving]
<asarch> I just was wondering about it because in the "The Art of Metaobject Protocol" CLOS was still not the defacto standard for Common Lisp (I guess that was the reason of Closette)
LiamH has quit [Quit: Leaving.]
Bike has joined #lisp
Lord_of_Life_ has joined #lisp
jdz has quit [Ping timeout: 265 seconds]
Josh_2 has quit [Read error: Connection reset by peer]
<aeth> asarch: AMOP was published in 1991, and the spec that CLHS is based off of was published in 1994 (it wasn't in the 1984 version of the language). The 1994 standard standardizes CLOS as part of the language, but as it was a late addition to the language, its use isn't necessary for most things.
jdz has joined #lisp
<aeth> I mean, besides its indirect use, since it can be used in the implementation of things that you use.
<aeth> You can also use a method without realizing it because of the unified syntax between functions and generic functions.
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life_ is now known as Lord_of_Life
shifty has joined #lisp
<asarch> Is there anything still pending to add to the standard?
<asarch> The standard is still alive, right?
<aeth> If anything is still waiting to be added to the standard, it's going to have to wait a very long time. :-)
<asarch> Wow!
<aeth> asarch: The ANSI standard is probably never going to be revised, but that just means that another official Standard™ (ANSI, ISO, ECMA, etc.) will probably never come. That doesn't mean that e.g. there can't be a de facto standard agreed upon by implementors, like Scheme's r5rs or r7rs.
<aeth> asarch: No one is working on such a standard at the moment, though.
gko_ has joined #lisp
nckx has quit [Ping timeout: 268 seconds]
<aeth> For the most part, people are content enough to have portability libraries over implementation-specific extensions, such as CFFI or bordeaux-threads.
<asarch> In your very own opinion of all of you, what else is missing?
<asarch> Would you be willing part of the committee?
<aeth> That is quite a controversial topic because quite a few people believe that there should never be another revision to the core language itself.
<Bike> can't be much worse than the standards arguments we already have
<asarch> What does it take to be part of that committee? Is it very expensive?
<aeth> asarch: Official standards are very expensive. Another one will probably never happen. Something "unofficial" like Scheme's r7rs process (just a bunch of people on the Internet voting on what goes into a PDF afaik) could happen, but there would have to be a community demand for that.
nckx has joined #lisp
<aeth> asarch: You would have to convince the major implementations (SBCL, CCL, ECL, etc.) to respect the results, though.
<aeth> Scheme's r6rs did not get widespread support and was too controversial.
msk has quit [Remote host closed the connection]
msk has joined #lisp
<aeth> asarch: As for me being on the committee, that's not my call because a future standard isn't my decision. You would basically at a minimum need the devs at #sbcl #ccl #ecl #clasp and #sicl to agree, as well as potentially the devs of the two major commercial Lisps: Allegro and LispWorks
<aeth> It is possible that they could (almost) all be in the same (actual) room at the same time at the European Lisp Symposium conference, though. So that's where the (very controversial) proposal would probably be made.
gko_ has quit [Ping timeout: 268 seconds]
<aeth> A proposal would have to be made by someone very respected in the community, like beach
<pjb> asarch: the CL standard is very much alive: https://www.youtube.com/watch?v=vnciwwsvNcc
<pjb> asarch: it's just resting.
<asarch> LOL :-)
<aeth> asarch: In fact, I don't think I know anyone except beach who could propose it and beach afaik currently isn't in favor of a new standard and usually says things along the lines of "Learn more of the language before proposing changes to the language." when newbies suggest a new standard.
<aeth> (Maybe I should've written his name censored so this doesn't bother him with mentions.)
oni-on-ion has joined #lisp
<aeth> But, anyway, basically: you would need to be a respected senior member of the community with a lot of experience and qualifications.
<asarch> I see
ebzzry has joined #lisp
<asarch> That's great, isn't it?
<aeth> The CL community is a rare community as far as programming languages go because it values being able to run decades-old code without modification, so changes and additions have to be very carefully considered.
<aeth> The people who want to clean things up radically moved to Scheme at least 30 years ago.
<housel> or Dylan :-)
<pjb> and they are still refining the scheme standard to the day…
<aeth> I guess you could compare CL's philosophy as far as stability is concerned to C, although C has had a few new standards that have made some minor additions.
<aeth> And that is, simliarly, because all of the people who want to add tons of shiny new features moved from C to C++ 30 years ago.
<asarch> Oh :-(
igemnace has joined #lisp
jjong has joined #lisp
<asarch> I guess that's why Scheme will never be considered as professional as Common Lisp :-(
karlosz has joined #lisp
torbo has joined #lisp
georgiePorgie has joined #lisp
jjong` has joined #lisp
<aeth> A professional language is the programming language that your boss makes you use.
<asarch> I know, but they always use "Academic" when they talk about Scheme
<asarch> Nowadays bosses use Java for the task ;-P
<pjb> Academia is also professional.
<pjb> asarch: as if, you went to your surgeon and told him what knife to use on your operation…
<aeth> asarch: An academic language is the programming language that your professor makes you use.
<asarch> I thought "Academic" was some "toy" a la Scratch :'-(
<aeth> it depends on what level the language is aimed at, e.g. Logo is aimed at a young audience.
<pjb> it depends on the tools provided. You could use logo professionaly, with the right compilers and development environments and libraries.
<pjb> look at python!
Josh_2 has joined #lisp
<aeth> pjb: we need Common Logo, a Common Lisp Logo implementation that gives the full power of CL to turtle graphics users!
<asarch> The Logo module for McCLIM
ebzzry has quit [Ping timeout: 240 seconds]
ebzzry has joined #lisp
Guest19180 has joined #lisp
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
__jrjsmrtn__ has joined #lisp
_jrjsmrtn has quit [Ping timeout: 265 seconds]
ebzzry has quit [Ping timeout: 240 seconds]
slyrus has joined #lisp
davepdotorg has joined #lisp
slyrus__ has quit [Ping timeout: 268 seconds]
karlosz has quit [Quit: karlosz]
rumbler31 has quit [Remote host closed the connection]
karlosz has joined #lisp
davepdotorg has quit [Ping timeout: 268 seconds]
Nilby has joined #lisp
ebzzry has joined #lisp
xkapastel has joined #lisp
Bike has quit [Quit: Lost terminal]
<asarch> These type specifiers http://www.lispworks.com/documentation/HyperSpec/Body/04_bc.htm, are they the same for the :element-type argument of (make-array)?
wsinatra has quit [Quit: WeeChat 2.7]
<asarch> How would you create an array of strings?
<no-defun-allowed> (make-array <dimensions> :element-type 'string)
<no-defun-allowed> The :element-type argument is a type specifier, yes.
<asarch> (let ((v (make-array 3 :element-type 'string))) (push v "common") (push v "lisp") (push v "rocks!"))
<asarch> My SBCL is broken: caught ERROR: Variable name is not a symbol: "common". etc
<Josh_2> push is for lists
<asarch> D'oh!
<Josh_2> You need to use (vector-push-extend ) http://clhs.lisp.se/Body/f_vec_ps.htm
ebzzry has quit [Ping timeout: 268 seconds]
milanj has quit [Quit: This computer has gone to sleep]
<no-defun-allowed> And the order for arguments to PUSH is (PUSH <value> <place>), such as (push "common" <list>)
msk has quit [Remote host closed the connection]
msk has joined #lisp
<asarch> (let ((v (make-array 3 :element-type 'string))) (vector-push-extend v "common") (vector-push-extend v "lisp") (vector-push-extend v "rocks!"))
<asarch> caught STYLE-WARNING: The default initial element 0 is not a STRING.?
<no-defun-allowed> Add an :initial-element value too, such as ""
<asarch> (let ((v (make-array 5 :adjustable t :initial-element "" :element-type 'string))) (vector-push-extend v "common") (vector-push-extend v "lisp") (vector-push-extend v "rocks!")) -> Evaluation aborted on #<SIMPLE-TYPE-ERROR expected-type: (AND VECTOR (NOT SIMPLE-ARRAY)) datum: "common">.
<asarch> Come on!
<Josh_2> make the type 'simple-array
<no-defun-allowed> aeth: Read the syntax of VECTOR-PUSH-EXTEND.
<no-defun-allowed> Or rather, asarch. But you are welcome to read it too, aeth.
<no-defun-allowed> (VECTOR-PUSH-EXTEND <new element> <vector>) ; so you probably want (vector-push-extend <the string> v)
EvW has quit [Ping timeout: 248 seconds]
<asarch> (let ((v (make-array 5 :adjustable t :initial-element "" :element-type 'string :fill-pointer 0))) (vector-push-extend "common" v) (vector-push-extend "lisp" v) (vector-push-extend "rocks!" v))
ahungry has joined #lisp
<asarch> I thought it was a la OOP: (method object argument)
shrdlu68 has quit [Ping timeout: 260 seconds]
<Josh_2> When you define a generic function you can put the object wherever you want
<no-defun-allowed> No, single-object oriented programming is a scam made by the Gang of Four to sell more design pattern books.
<Josh_2> X to doubt
<aeth> asarch: (1) It's (probably) not a method and (2) multiple-dispatch means you can dispatch anywhere
<no-defun-allowed> ...and CLOS came in much later than most of the Common Lisp functions.
<aeth> asarch: OOP would be foo.bar(baz, ...) which doesn't exist in CL. An equivalent could be something like (dot foo bar baz ...) but in CL it's just (bar foo baz ...) just like the "normal" language's bar(foo, baz, ...) because of the unified syntax
<aeth> And hte first argument isn't special
<aeth> s/hte/the/
<aeth> e.g. (defmethod foobar (foo (bar barfoo)) ...) only dispatches on the 2nd
<asarch> Yeah, in message sending oop languages, it would be something a la: v.push("common"), however, in generic dispatching oop is (push v "common"), right?
<aeth> So even if you're only doing single-dispatch, because the system itself is multiple-dispatch, there's no priviledged "self" first argument like in Python
<aeth> asarch: you can't be sure that the order is reasonable in CL
<aeth> it's an old language with lots of compatibility
<aeth> asarch: personally, I would do (vector-push vector new-element) if I were to write it myself today, but because it's probably from like 1974 before they had API consistency, it's (Vector-push new-element vector)
<aeth> It helpds to use something like SLIME to see the API
<asarch> How would you do the same with lists?: (let ((v (list nil))) (append v "common") (append v "lisp") (append v "rocks!") (format t "Value: ~a~%" v))
<asarch> > Value: (NIL)
<aeth> asarch: Basically, the CL authors would rather have some of the older functions with ugly APIs than do a Python 3 situation... and they managed to think of avoiding that kind of mess decades before the Python 3 situation happened.
<aeth> (And for all I know, the programming world didn't start thinking that the other order was natural until the 90s or 00s)
<no-defun-allowed> asarch: APPEND does not mutate its arguments, nor will it work as expected with non-list arguments.
<aeth> asarch: The same with lists is just... push
<aeth> lists are the oldest data structure so some of their names are more convenient
<no-defun-allowed> You are going to have a lot of questions if you second-guess the functions in Common Lisp instead of reading the appropriate documentation.
<no-defun-allowed> clhs append
<aeth> asarch: note that a common pitfall is that push modifies a place, not a list itself, since a list is just a bunch of cons cells. http://www.lispworks.com/documentation/HyperSpec/Body/m_push.htm
<aeth> So if you push in a helper function, the caller won't see that modification.
<Josh_2> Like aeth says, it really helps to have something like SLIME to tell you the argument order
<aeth> asarch: Generally, vectors work the way you expect them to, but list mutation macros tend to require some care.
<aeth> There are lots of ways around that, like relying on a return value, or by building your own data structure on top of lists (most trivially, just putting the list in a 1-length vector or something similar)
asdf_asdf_asdf has quit [Remote host closed the connection]
* asarch is fixing his notes once again...
<aeth> (let ((l (list 1 2 3))) (push 0 l) l) => (0 1 2 3)
<aeth> (defun g (l) (push 0 l)) (defun f () (let ((l (list 1 2 3))) (g l) l)) (f) => (1 2 3)
<aeth> Vectors don't have that issue when you push.
<aeth> One fix in my example is to just return the result of (g l) like this: (defun g (l) (push 0 l)) (defun f () (let ((l (list 1 2 3))) (g l) l)) (f) => (0 1 2 3)
<aeth> But sometimes you have to be careful with your API design
<aeth> A vector version: (defun g (v) (vector-push-extend 0 v)) (defun f () (let ((v (make-array 3 :adjustable t :fill-pointer 3 :initial-contents '(1 2 3)))) (g v) v)) (f) => #(1 2 3 0)
<aeth> MAKE-ARRAY is complicated because it does a lot of things. Usually if you only care about a few features, you make a tiny helper function. And if you didn't need an adjustable vector you'd just use (vector 1 2 3) instead of that MAKE-ARRAY mess
<aeth> oh oops, I didn't copy the correction so I pasted the same thing twice. The corrected list version is: (defun g (l) (push 0 l)) (defun f () (let ((l (list 1 2 3))) (g l))) (f) => (0 1 2 3)
<aeth> asarch: I hope that helps. If you need more detail, we should probably take this to #clschool because it's pretty basic
georgiePorgie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gendl> Xach: what is this .cl TLD you speak of? I just tried some .cl domains on namecheap and it comes back as "invalid TLD"
<no-defun-allowed> That is the TLD for Chile.
<aeth> two letters is a country code
<aeth> sometimes they're widely available e.g. .co
<gendl> hmm. I guess Namecheap isn't set up to dispense the .cl TLD.
<aeth> (It has an Internet ccTLD column)
<aeth> There are a few that don't match the country code e.g. .uk vs. GB
<pjb> asarch: use clhs!!!
<pjb> asarch: lisp operators are not commutative!!!
<pjb> asarch: in message sending languages you would do: recipient message:argument.
<pjb> gendl: .cl is Chile.
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
Khisanth has quit [Ping timeout: 265 seconds]
<mfiano> gendl: i forgot where i registered lisp.cl
<mfiano> Ah, 101domain
georgiePorgie has joined #lisp
orivej has joined #lisp
msk_ has joined #lisp
Oladon has joined #lisp
Khisanth has joined #lisp
msk has quit [Read error: Connection reset by peer]
phlim has quit [Quit: WeeChat 2.4]
phlim has joined #lisp
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
refpga has quit [Remote host closed the connection]
refpga has joined #lisp
davepdotorg has joined #lisp
phlim has quit [Quit: phlim]
rumbler31 has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
Fare has joined #lisp
orivej has quit [Ping timeout: 265 seconds]
davepdotorg has quit [Ping timeout: 265 seconds]
rumbler31 has quit [Ping timeout: 268 seconds]
Fare has quit [Ping timeout: 260 seconds]
sjl has joined #lisp
mfiano2 has joined #lisp
loke has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
gravicappa has joined #lisp
<beach> Good morning everyone!
<Josh_2> Mornin beach
georgiePorgie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
georgiePorgie has joined #lisp
<refpga> Hello, Quiennec says in Lisp In Small pieces that modifiction in functional environment/namespace in CL is not possible, due to unavailability of any assignment form to do it. Although he refers to defun on the topic of redefinition. What is the difference between redefinition in function namespace, and the unavailable modification?
<refpga> Sorry, he says this about Lisp_2
<beach> I don't see how that is relevant for Common Lisp, since we have (SETF FDEFINITION).
<beach> Oh, I guess it is not possible for functions introduced by LABELS or FLET.
<beach> So perhaps he means that you can do (let ((x ...)) (setf x ...)), but not (flet ((f ...)) <modify f>)
<refpga> If you define two consecutive functions via labels, then the latest/second one is used.
<beach> That's different from assignment though. That's shadowing.
<beach> Shadowing would not alter the binding in an outer scope.
<refpga> You mean the scope changes instead of binding? I see.
<beach> Yes.
<refpga> Do you know if defun shadows or mutates the function binding?
MinnowTaur has quit [Ping timeout: 260 seconds]
<refpga> I mean, redefinition using defun, does it shadow the previous one?
akoana has joined #lisp
kmeow has joined #lisp
<beach> It mutates, because it affects only the global binding. So it does (setf (fdefinition <name>) (lambda ...))
<beach> Common Lisp does have an assignment operation for global function bindings.
<beach> DEFUN could not shadow, because if it did, you would then have to write the rest of your code in the body of the DEFUN.
<beach> ... so that it would be in the scope of the new definition.
<refpga> Yeah.
<refpga> Thanks
<beach> Sure.
ahungry has quit [Remote host closed the connection]
kmeow has quit [Ping timeout: 260 seconds]
georgiePorgie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<refpga> beach: I am still able to do (setf (fdefinition <name>) (lambda ...)) with labels' functions.
<beach> Yes, but it won't affect the lexical binding.
<beach> Try (labels ((f (x) (+ x 2))) (setf (fdefinition 'f) (lambda (x) (+ x 3))) (f 10))
MinnowTaur has joined #lisp
<refpga> Wait, no, I used (funcall (setf ..)) instead of applying it directly (f 10).
<refpga> So yeah, we can't.
<beach> Right, so you called the global binding.
<refpga> Yeah
orivej has joined #lisp
Oladon has quit [Quit: Leaving.]
torbo has quit [Remote host closed the connection]
swills has quit [Ping timeout: 268 seconds]
swills has joined #lisp
dale has joined #lisp
pvaneynd_ has quit [Ping timeout: 245 seconds]
akoana has left #lisp ["Leaving"]
orivej has quit [Ping timeout: 265 seconds]
kmeow has joined #lisp
kmeow has quit [Client Quit]
kmeow has joined #lisp
mason has quit [Quit: leaving]
dddddd has quit [Remote host closed the connection]
mason has joined #lisp
ebzzry has joined #lisp
davepdotorg has joined #lisp
shrdlu68 has joined #lisp
davepdotorg has quit [Ping timeout: 268 seconds]
pvaneynd has joined #lisp
<asarch> Bingo! I have finished to copy everything! :-)
ggole has joined #lisp
narimiran has joined #lisp
<asarch> (let ((v (list))) (push "common" v) (push "lisp" v) (push "rocks!" v) (format t "Value: ~a~%" v))
<asarch> Can you have an array of different data types? If yes, how?
<no-defun-allowed> Without an :element-type, the array can store any type of data.
<no-defun-allowed> (The :element-type defaults to T, which is a type that every object is a member of.)
oxum has quit [Remote host closed the connection]
space_otter has joined #lisp
<asarch> Thank you! Thank you very much guys! :-)
FreeBird_ has quit [Remote host closed the connection]
<asarch> The first time I wrote about arrays (re sizable) was with integer values, so I assume it was the same for strings (the notes I forgot to do was to use VECTOR-PUSH-EXTEND instead of only PUSH and always initialize the array with a size and a :fill-pointer of 0)
<asarch> That's why I miserable failed this time :'-(
FreeBirdLjj has joined #lisp
<no-defun-allowed> If you intend to use V-P-E, you should also ensure the array is adjustable.
<asarch> Ok
<Nilby> If you want to repeatedly append to a string with-output-to-string might be most effective.
<asarch> I did an array of objects here (lines #60 and #66): https://github.com/asarch/flor/blob/master/flor.lisp
<beach> asarch: What is the objective of your exercise? You don't seem to use this knowledge to write Common Lisp programs. Are you writing a book?
<asarch> No, I am not writing any book at all
<beach> Then what are you up to? :)
vlatkoB has joined #lisp
shifty has joined #lisp
<asarch> A friend of mine (a medical doctor) is taking lessons about data mining with Python. However, I am trying to convincing him to use Common Lisp instead
<asarch> For that, I am "writing a mini tutorial" about the principles of Common Lisp programming
<beach> I strongly advice against such an exercise, especially if you don't know Common Lisp yourself.
<asarch> Exactly! A blind guy guiding another blind guy :-P
<beach> Your friend is going to make mistakes, and you will be unable to help.
<asarch> The firs step was done with CL REPL for Android
<beach> Wow, that code needs a lot of work.
<asarch> At noon I was at the part of '("common" "lisp" "rocks") when I realize about the data type of '(common lisp rocks!) <- SYMBOLS!
<Nilby> But maybe his friend will be like another Kevin Rosenberg.
<beach> That's precisely my point. What basis do you have for recommending a language that you only know a tiny part of.
<asarch> Yeah, I know. Mostly because cl-glut is not finished yet (the part of the menus fails)
<beach> No, that code needs work, because it doesn't correspond to elementary style conventions.
<asarch> Well, you know. Common Lisp has always been considered the programming language of smart people :-)
<asarch> Yeah, yeah. Sorry for my style :'-(
shka_ has joined #lisp
<beach> I think you just reversed your causality.
sauvin has joined #lisp
<asarch> I just want to "infect" his brain with Common Lisp, the rest is up to him :-P
<asarch> As the "Land of Lisp" book says: "once you tried Common Lisp, you never will be the same"
<no-defun-allowed> "In a world of blind people, the one eyed people run it and the two eyed people are in for a hell of a ride."
<alandipert> enthusiasm goes a long way. godspeed asarch!
oxum_ has joined #lisp
<asarch> And, as the old adage used to say: the best way to learn is to teach, right?
<no-defun-allowed> Maybe, maybe not.
<alandipert> not sure it's the best way, but it's a way, no doubt :-)
FreeBirdLjj has quit [Ping timeout: 272 seconds]
<Josh_2> asarch: It's a good way to remember thigns
<no-defun-allowed> I wouldn't follow sayings just because.
<asarch> I don't even know I had those "basic questions" until this noon when I tried to explain how to create arrays in Common Lisp (my notes were literally blank for those questions)
<asarch> s/don't/din't/
<asarch> "That, who doesn't follow sayings don't get to be an old man" says the saying :-P
FreeBirdLjj has joined #lisp
<asarch> Who knows :-)
<no-defun-allowed> What about "Tradition is peer pressure from dead people"? I would say the same for all those damn sayings.
<asarch> Touché!
<asarch> I hope some day I could teach Japanese (無料の日本語レッスン)
<oni-on-ion> impossible japanese lesson? =) japanese love lisp.
<beach> asarch: The good way to learn a foreign language is by reading, writing, listening, and speaking. Not by asking other people what the grammar rules are. If you do it the wrong way, you will produce nonsensical and unconventional phrases.
zaquest has quit [Quit: Leaving]
<beach> asarch: The good way to learn a programming language is by reading code written by experts, and practicing by writing it and get feedback. Not by asking other people what the semantics are.
<asarch> I know (the other quickly way is to get married with a native person). However, grammar is always...
<beach> If you do it the wrong way, you will produce nonsensical and unconventional programs.
shka_ has quit [Ping timeout: 268 seconds]
<oni-on-ion> like learning our first language as a baby: like our life depended on it. then we are natural with it, having internalized a great deal of meaning and possibilities of expression
<asarch> If everything was the first language, everything was fine. However, when you pass from C++ to Perl to Python to JavaScript... (like from Spanish to English to German to Japanese) :'-(
<asarch> *everything would be fine...
* Nilby produces mostly nonsensical and unconventional programs.
<beach> asarch: I say, tell your friend to come here and ask questions directly, to show the programs that he or she writes, so as to get feedback from people with more experience and more knowledge than you have.
<asarch> I already did it! That was the step #2. The use of this IRC channel (with an IRC-client for his "shining Mac OS baby Operating System") :-P
<beach> asarch: What you are up to is very likely going to end in tears.
<asarch> He used to be an Slacker (Slackware 10)
<pjb> asarch: once you try anything, you never will be the same, (unless you're gavino), since you've learned something! You will forever have the memory of the thing you tried.
<pjb> asarch: it's not specific to lisp.
<beach> asarch: Plus, it gets boring to answer elementary questions. Normally, the person makes progress and no longer needs to ask elementary questions. But since you don't practice, you make very little progress.
<pjb> still not knowing that foo is a symbol… pffft!
<beach> Yes, very elementary. And asarch has been coming here for quite some time.
visage_ has joined #lisp
<beach> October 19, 2017 in fact.
<beach> More than two years, and still not knowing what a symbol is.
<asarch> I know, I know. I suck. I'm still porting my https://github.com/asarch/apt-cache/ to a most powerful web server (Hunchentoot?) than PortableAllegroServer
<beach> That has got to be some kind of record.
<oni-on-ion> oh wow. beach you should be commended for your patience, and efforts.
<oni-on-ion> what was he coding in previously?
<beach> oni-on-ion: Can I assume that was not supposed to be sarcasm?
<pjb> asarch: you see, this is the problem. You're trying to work on lisp program while still not having learned the most basic. You're like a baby who doesn't know how to walk, and you'd want to work as CEO of Nike…
<pjb> s/to work/to walk/
clothespin has quit [Ping timeout: 260 seconds]
zaquest has joined #lisp
<pjb> asarch: stop everything, take two months of your time, and study Common Lisp: A Gentle Introduction to Symbolic Computation http://www.cs.cmu.edu/~dst/LispBook/ http://www-cgi.cs.cmu.edu/afs/cs.cmu.edu/user/dst/www/LispBook/index.html
<beach> asarch: I find this behavior of yours very impolite, even though superficially your phrases are humble.
<asarch> That was my first approach pjb
<oni-on-ion> beach, nope. i think you are very patient with people's "traits", myself included. its well above average.
<asarch> I stopped to read that book the time I tried to (setf foo "bar") instead of (let ((foo "bar")) ...) <- The book actually doesn't explain it
<oni-on-ion> there must be some existing memory or concept in his mind that could be related to something he does not understand, such as what is a symbol
<asarch> I mean, the first time you learn Python, you read something like:
<asarch> a = 10
<asarch> "The variable 'a' now values 10"
<oni-on-ion> lambda calculus. do u know any math ?
<no-defun-allowed> asarch: Now, how does that work when another function tries to access it?
<oni-on-ion> if you are reading and writing code as literal prose then it wont work. there are concepts *behind* the literal text. i think that is where the darkness of learning resides
<no-defun-allowed> In Python, that scope is (mostly) implicit (unless you use the `global` keyword in the body of a function), which leads to a large set of bugs.
<Josh_2> asarch: I agree with pjb
<aeth> asarch: programming, like math, is a learn-by-doing subject that's best learned by doing as many exercises as possible, or in the case of programming, writing programs, which are even more practical and useful than exercises.
<aeth> What's great about CL is you can just enter things in the REPL and in effect ask it your questions, once you learn how to learn CL
<oni-on-ion> there is more than meets the eye
<oni-on-ion> yea have a conversation with the compiler, cant learn much language without actual practice of it. ("like your life depended on it" - our whole life is language-learning - all we see is symbolic to deeper meaning, which increases by the act of learning (lights up the darkness)) ahem so asarch just spend more time speaking lisp. with the main entities that everyone speaks it with, the compiler (REPL). otherwise it wont grow into anything
<oni-on-ion> beyond what it looks like on the screen.
<asarch> In Common Lisp you can't do the Python example because you need a scope for the variable
<no-defun-allowed> Correct.
<asarch> Scope is a very important concept in Common Lisp
<asarch> The book simply doesn't mention
<asarch> So, you "grow" with the lack of that info and then eventually...
<asarch> *grow up
<Josh_2> wat
<beach> oni-on-ion: Thanks!
<pjb> actually, it works at the REPL. It's just that it's not conforming. It is not specified what kind of variable you get. So I don't know what you're complaining about.
<no-defun-allowed> And then in Python, using `with` will trash the current scope, because it does not establish a new scope for the variable that is being bound. There are only a few places you can establish a new scope to create new bindings.
<Josh_2> it talks about scoping in the final chapter
<Nilby> oni-on-ion: I like your poetic description of conversing with a REPL :)
_whitelogger_ has joined #lisp
thonkpod has joined #lisp
<Cymew> Look at that, they are. I had forgotten that.
<Cymew> Makes sense, though.
<beach> So are functions, classes, methods, effective slot definitions, ...
JohnMS_WORK has joined #lisp
larme has joined #lisp
<asarch> Once you get used to with those concepts, you find Common Lisp very pleasant since you don't actually need ; and { ... } and tabs to define scopes, right?
<Josh_2> I think you should go to #clschool
<aeth> Common Lisp... has one of the most explicit scoping systems out there, and is thus a bit more verbose and 'less convenient" even though imo it leads to more reliable code
<beach> So for example when a method combination creates an effective method from individual methods, the expression being compiled likely contains some such atoms.
<pjb> Yeah, exactly right! It's because we don't need the semi-colon and the braces that lisp is so nice.
<asarch> (if predicate foo bar) can be expanded to (if predicate (let ...) (let ...))
<oni-on-ion> atom = "smallest part[icle]" ?
<beach> asarch: Will you please stop it now!
<pjb> oni-on-ion: no, it means indivisible.
<aeth> oni-on-ion: except in CL it can include huge "collection" sort of things, not things you think of as "basic" like 42 or #\c
<pjb> oni-on-ion: but atoms, like atoms, are discovered not to be so indivisible after all.
<aeth> I guess 42 and #\c should be called subatomic-particles
<asarch> Ok, ok :-(
<aeth> (just like in RL, when you split an atom)
<oni-on-ion> pjb, so yes then XD the smallest part is without being possible to divide further.
<pjb> atoms are split into electrons and nucleus (itself divisible into protons and neutrons, themselves …), and atoms are split into slots and other attributes.
<aeth> asarch: This channel will tend to be harsher/ruder with the basics when compared to #clschool
<oni-on-ion> pjb, and yep -- smaller stuff than atoms irl =) (we can say bits and bytes in lisp though)
<pjb> in physics, atom are just nucleus with electrons. in lisp, atoms are anything that is not a cons cell.
<aeth> we should come up with a term for things that don't have slots (I'm counting e.g. (aref foo 42) as a slot access, too), like (non-complex?) numbers and characters
<oni-on-ion> except cons cell -- yeah makes sense. but wait, (cons a b) is not an atom?
<aeth> oni-on-ion: it's defined relative to iterating over a list
<oni-on-ion> or are cons different
<pjb> nope. It's a cons cell, containing cons in its car, and (a b) in its cdr.
<pjb> and neither is (a . d) a n atom. It's a cons cell containing a in its car, and d in its cdr.
FreeBird_ has joined #lisp
<aeth> oni-on-ion: relative to iterating over a list, you have cons and not-cons, it's just that not-cons is called "atom" even though that's sort of confusing in other contexts
<aeth> And of the atoms, NIL is sort of special for list iteration
FreeBirdLjj has quit [Ping timeout: 268 seconds]
<asarch> aeth: I know, right now some guys are in a fight in a corner of the channel. The rude guys! The rude guys! \o/
<oni-on-ion> ah right. hmm. i've always thought of them as (cons a b) --- because of the books i read. it made car/cdr/etc confusing. (i dont think all books are for everyone)
<oni-on-ion> pjb, ah i see
<oni-on-ion> hmm. going to play around with that in repl to solidify the understanding. thx
rumbler31 has joined #lisp
<pjb> (mapcar 'atom '(1 "one" one (o n e) #c(1 2) #(1 one "one" (o n e)))) #| --> (t t t nil t t) |#
<pjb>
z147 has joined #lisp
vaporatorius has quit [Ping timeout: 268 seconds]
rumbler31 has quit [Ping timeout: 248 seconds]
vaporatorius has joined #lisp
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
dale has quit [Quit: My computer has gone to sleep]
brown121407 has joined #lisp
<asarch> Who is Kevin Rosenberg anyway?
<oni-on-ion> pjb, ohhh. yeah, ok i did know that. i was thinking about the function cons itself. but a much deeper perspective on conses has grown now. =)
adriano1 has joined #lisp
jjongMc has joined #lisp
shrdlu68 has quit [Ping timeout: 265 seconds]
oxum_ has quit [Read error: Connection reset by peer]
oxum has joined #lisp
adriano1 has quit [Ping timeout: 268 seconds]
davepdotorg has joined #lisp
milanj has joined #lisp
jprajzne_ has quit [Read error: Connection reset by peer]
davepdotorg has quit [Ping timeout: 268 seconds]
orivej has joined #lisp
shangul has joined #lisp
vaporatorius has quit [Ping timeout: 268 seconds]
vaporatorius has joined #lisp
jjongMc has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
visage_ has quit [Quit: visage_]
shrdlu68 has joined #lisp
orivej has quit [Ping timeout: 260 seconds]
v_m_v has joined #lisp
kajo has quit [Ping timeout: 265 seconds]
pvaneynd has quit [Remote host closed the connection]
shrdlu68 has quit [Ping timeout: 240 seconds]
pvaneynd has joined #lisp
georgiePorgie has joined #lisp
<asarch> Have a nice day
<asarch> See you later :-)
<asarch> Thanks for all!
asarch has quit [Quit: Leaving]
rwcom2 has joined #lisp
pvaneynd has quit [Ping timeout: 245 seconds]
rwcom has quit [Ping timeout: 268 seconds]
rwcom2 is now known as rwcom
v_m_v has quit [Ping timeout: 260 seconds]
karlosz has quit [Quit: karlosz]
kajo has joined #lisp
davepdotorg has joined #lisp
msk has joined #lisp
msk_ has quit [Read error: Connection reset by peer]
gxt has joined #lisp
oni-on-ion has quit [Remote host closed the connection]
space_otter has quit [Remote host closed the connection]
hhdave has joined #lisp
easye has quit [Remote host closed the connection]
oxum has quit [Read error: Connection reset by peer]
oxum has joined #lisp
shrdlu68 has joined #lisp
jonatack has quit [Ping timeout: 248 seconds]
wxie has joined #lisp
sunwukong has joined #lisp
pvaneynd has joined #lisp
heisig has joined #lisp
heisig has quit [Client Quit]
oxum has quit [Read error: Connection reset by peer]
oxum_ has joined #lisp
heisig has joined #lisp
heisig has quit [Client Quit]
wxie has quit [Ping timeout: 260 seconds]
msk has quit [Remote host closed the connection]
msk has joined #lisp
georgiePorgie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
v_m_v has joined #lisp
shifty has quit [Ping timeout: 268 seconds]
_whitelogger has joined #lisp
z147 has quit [Quit: z147]
oxum has joined #lisp
adriano1 has joined #lisp
oxum__ has joined #lisp
refpga has quit [Ping timeout: 260 seconds]
oxum_ has quit [Ping timeout: 268 seconds]
brown121407 has quit [Remote host closed the connection]
ljavorsk has joined #lisp
rumbler31 has joined #lisp
oxum has quit [Ping timeout: 272 seconds]
cartwright has quit [Remote host closed the connection]
cartwright has joined #lisp
frodef has joined #lisp
jonatack has joined #lisp
rumbler31 has quit [Remote host closed the connection]
sunwukong has quit [Remote host closed the connection]
shifty has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
pvaneynd has quit [Ping timeout: 260 seconds]
oxum has joined #lisp
msk_ has joined #lisp
oxum__ has quit [Ping timeout: 260 seconds]
msk has quit [Ping timeout: 265 seconds]
Necktwi has quit [Ping timeout: 248 seconds]
v88m has quit [Remote host closed the connection]
v88m has joined #lisp
oxum has quit [Ping timeout: 268 seconds]
pvaneynd has joined #lisp
oxum has joined #lisp
ljavorsk has quit [Remote host closed the connection]
ljavorsk has joined #lisp
<p_l> a bit of archeological question - what's the newest lisp implementation that can be used to build CMUCL from source?
<jackdaniel> cmucl of course :)
vaporatorius has quit [Read error: Connection reset by peer]
cosimone has joined #lisp
vaporatorius has joined #lisp
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
shrdlu68 has quit [Remote host closed the connection]
<p_l> well, one that is *not* cmucl
<p_l> because building purely from source using other lisp seems to me to require late-version MACLISP from CMU...
<jackdaniel> if I understand correctly cmucl build process depends on cmucl-specific things of the compiler; afaik that's one of few reasons why sbcl forked from cmucl
<p_l> yep
<jackdaniel> so indeed you'd need to take an early source of cmucl, run maclisp on something and build it
<jackdaniel> then use this early build of cmucl to build newer version
<jackdaniel> etc etc
<jackdaniel> or you may fork cmucl and reimplement sbcl! ,)
<frodef> ..or why not just pull yourself up by the bootstraps? :)
<jackdaniel> alternatively you could write a "cmucl portability layer" which adds missing operators which the build process requires to the host compiler
<jackdaniel> s/to the/from the/
<p_l> jackdaniel: that's partially what SBCL did (except it also modified core generation afaik to not depend on dumping host core)
<jackdaniel> well, "to the" was refering to what you add, and "from the" refers to the build process which requires
Zotan has quit [Ping timeout: 248 seconds]
Zotan has joined #lisp
narimiran has quit [Ping timeout: 265 seconds]
<Nilby> I tried to build cmu a few days ago from current source and it failed. Does anyone use it on "amd64" linux or am I just missing something?
oxum has quit [Read error: Connection reset by peer]
bitmapper has joined #lisp
vaporatorius has quit [Read error: Connection reset by peer]
pvaneynd has quit [Remote host closed the connection]
pvaneynd has joined #lisp
adriano1 has quit [Ping timeout: 265 seconds]
jjong has quit [Remote host closed the connection]
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vaporatorius has joined #lisp
Guest19180 has quit [Ping timeout: 240 seconds]
Solenoid_Snake has joined #lisp
v_m_v has quit [Remote host closed the connection]
adriano1 has joined #lisp
oxum has joined #lisp
oxum_ has joined #lisp
oxum has quit [Ping timeout: 265 seconds]
bitmapper has quit []
jonatack has quit [Ping timeout: 268 seconds]
orivej has joined #lisp
vaporatorius has quit [Ping timeout: 260 seconds]
vaporatorius has joined #lisp
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
cosimone has quit [Quit: Terminated!]
shrdlu68 has joined #lisp
dddddd has joined #lisp
oxum has joined #lisp
georgiePorgie has joined #lisp
oxum_ has quit [Ping timeout: 265 seconds]
v_m_v has joined #lisp
v_m_v has quit [Ping timeout: 260 seconds]
shrdlu68 has quit [Ping timeout: 245 seconds]
shrdlu68 has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
Cyzx400 has joined #lisp
Solenoid_Snake has quit [Ping timeout: 272 seconds]
Solenoid_Snake has joined #lisp
Cyzx400 has quit [Ping timeout: 240 seconds]
FreeBird_ has quit [Remote host closed the connection]
Josh_2 has quit [Quit: ERC (IRC client for Emacs 26.3)]
v_m_v has joined #lisp
Lord_of_Life_ has joined #lisp
v_m_v has quit [Remote host closed the connection]
Cyzx400 has joined #lisp
vaporatorius has quit [Read error: Connection reset by peer]
Lord_of_Life has quit [Ping timeout: 240 seconds]
Lord_of_Life_ is now known as Lord_of_Life
Solenoid_Snake has quit [Ping timeout: 248 seconds]
kmeow has quit [Remote host closed the connection]
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vaporatorius has joined #lisp
FreeBirdLjj has joined #lisp
v_m_v 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.]
Guest19180 has joined #lisp
milanj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 268 seconds]
v_m_v has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
Guest19180 has quit [Ping timeout: 268 seconds]
oxum has quit [Ping timeout: 240 seconds]
georgiePorgie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oxum has joined #lisp
oxum has quit [Read error: Connection reset by peer]
oxum has joined #lisp
Odin- has quit [Quit: Meep.]
milanj has quit [Read error: Connection reset by peer]
narimiran has joined #lisp
milanj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #lisp
Solenoid_Snake has joined #lisp
v_m_v has joined #lisp
Cyzx400 has quit [Ping timeout: 265 seconds]
v_m_v has quit [Remote host closed the connection]
v_m_v has joined #lisp
random-nick has joined #lisp
<frodef> Is there a function I can give to REDUCE that will just yield the input list back?
igemnace has quit [Quit: WeeChat 2.7]
<jackdaniel> (reduce #'list* '(1 2 3 4 5) :from-end t :initial-value '())
<jackdaniel> frodef: ^
<_death> or (lambda (s x) (append s (list x)))
jonatack has joined #lisp
gko_ has joined #lisp
<frodef> thanks. not quite intuitive to me that from-end will change things like that.
<jackdaniel> lists are consed from the last cons up
<_death> (list* 1 (list* 2 (list* 3 (list* 4 (list* 5 nil)))))
<jackdaniel> so instead of taking paris from the left (1 . 2), then ((1 . 2) . 3) etc
<jackdaniel> you go (5 . nil), (4 . (5 . nil)) etc
<frodef> right you are, thank you both.
<jackdaniel> what gives you the list
gxt has quit [Remote host closed the connection]
<jackdaniel> huh, Paris is a weird city, full of conses (reading myself)
<_death> (so cons would also work)
gxt has joined #lisp
jonatack has quit [Quit: jonatack]
<frodef> for two args, cons and list* are the same, no?
<jackdaniel> it is only different for unary argument from cons
<jackdaniel> (conceptually that is)
ebzzry has joined #lisp
<jackdaniel> that doesn't sound good, they are of course different functions, but you know what I mean (I hope!)
<_death> as an exercise you can implement my-list*
<_death> after movitz it should be a breeze ;)
<frodef> I'm going for 64-bit.
<jackdaniel> it must be something with nicks starting with "fro" what makes people target "bare metal" ;-)
<_death> ferro
<frodef> hm... froggey?
<jackdaniel> frodef: froggey is Mezzano author
EvW1 has joined #lisp
<pjb> frodef: there is none, because the function you give to reduce is only passed the elements of the input list, not the input list itself.
ljavorsk has quit [Ping timeout: 268 seconds]
<frodef> pjb: I meant the same as in EQUAL, not EQ.
<pjb> frodef: you would have to use maplist: (let ((list '(1 2 3 4 5))) (eq list (mapl (lambda (list) list) list))) #| --> t |#
<jackdaniel> it is the input list if we consider that from equal perspective :)
adriano1 has quit [Ping timeout: 265 seconds]
lucasb has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
<pjb> jackdaniel: well, Paris is full of cons, indeed…
FreeBirdLjj has joined #lisp
<pjb> frodef: _death: (list* 1 2 3 4 5 nil) #| --> (1 2 3 4 5) |#
shrdlu68 has quit [Ping timeout: 272 seconds]
xkapastel has joined #lisp
philadendrite has quit [Remote host closed the connection]
Necktwi has joined #lisp
philadendrite has joined #lisp
philadendrite has quit [Remote host closed the connection]
philadendrite has joined #lisp
FreeBirdLjj has quit [Ping timeout: 252 seconds]
<_death> I was giving the expansion of reduce.. (defun qlist* (&rest args) `(list* ,@args)) (reduce #'qlist* '(1 2 3 4 5) :from-end t :initial-value '()) => (LIST* 1 (LIST* 2 (LIST* 3 (LIST* 4 (LIST* 5 NIL)))))
<pjb> oh, ok.
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 246 seconds]
X-Scale` has joined #lisp
Lord_of_Life has quit [Excess Flood]
FreeBirdLjj has joined #lisp
vap1 has joined #lisp
X-Scale has quit [Ping timeout: 260 seconds]
X-Scale` is now known as X-Scale
vaporatorius has quit [Ping timeout: 265 seconds]
Lord_of_Life has joined #lisp
Odin- has joined #lisp
gabiruh has quit [Quit: ZNC - 1.6.0 - http://znc.in]
gabiruh has joined #lisp
Bike has joined #lisp
thijso has quit [Ping timeout: 268 seconds]
orivej has quit [Ping timeout: 268 seconds]
adriano1 has joined #lisp
pfdietz has joined #lisp
thijso has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
oxum_ has joined #lisp
oxum has quit [Ping timeout: 260 seconds]
oxum_ has quit [Ping timeout: 248 seconds]
lnostdal_ has joined #lisp
rwcom4 has joined #lisp
rwcom has quit [Ping timeout: 246 seconds]
rwcom4 is now known as rwcom
oxum has joined #lisp
pvaneynd has quit [Ping timeout: 248 seconds]
jmercouris has joined #lisp
fookara has joined #lisp
oxum has quit [Ping timeout: 240 seconds]
easye has joined #lisp
pvaneynd has joined #lisp
fookara has quit [Remote host closed the connection]
LiamH has joined #lisp
msk_ has quit [Remote host closed the connection]
msk_ has joined #lisp
frodef` has joined #lisp
frodef has quit [Ping timeout: 260 seconds]
oxum has joined #lisp
FreeBird_ has joined #lisp
FreeBirdLjj has quit [Ping timeout: 265 seconds]
sjl_ has joined #lisp
sjl_ has quit [Client Quit]
Posterdati has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
sjl_ has joined #lisp
v_m_v has quit [Remote host closed the connection]
fookara has joined #lisp
v_m_v has joined #lisp
jprajzne has quit [Quit: Leaving.]
shka_ has joined #lisp
msk_ has quit [Remote host closed the connection]
msk_ has joined #lisp
efm has quit [Quit: Konversation terminated!]
Posterdati has joined #lisp
pvaneynd has quit [Remote host closed the connection]
pvaneynd has joined #lisp
efm has joined #lisp
msk has joined #lisp
msk_ has quit [Remote host closed the connection]
v_m_v has quit [Remote host closed the connection]
pvaneynd has quit [Ping timeout: 248 seconds]
oxum has quit [Ping timeout: 272 seconds]
fookara has quit [Remote host closed the connection]
fookara has joined #lisp
shrdlu68 has joined #lisp
wsinatra has joined #lisp
gxt has quit [Ping timeout: 240 seconds]
jprajzne has joined #lisp
jprajzne has quit [Client Quit]
Guest19180 has joined #lisp
jprajzne has joined #lisp
fookara has left #lisp ["ERC (IRC client for Emacs 27.0.50)"]
dvdmuckle has quit [Quit: Bouncer Surgery]
Guest19180 has quit [Ping timeout: 265 seconds]
dvdmuckle has joined #lisp
oxum has joined #lisp
<pfdietz> When you make a pull request and nothing happens.
pvaneynd has joined #lisp
v_m_v has joined #lisp
pvaneynd_ has joined #lisp
FreeBird_ has quit [Remote host closed the connection]
dddddd has quit [Remote host closed the connection]
pvaneynd has quit [Ping timeout: 248 seconds]
v_m_v has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
smazga has joined #lisp
Fare has joined #lisp
msk has quit [Remote host closed the connection]
msk has joined #lisp
<ck_> oh, are you watching the github show too? I was told there would be interaction
<ym> pfdietz, change f to s in your nickname.
Cymew has quit [Ping timeout: 265 seconds]
Guest19180 has joined #lisp
fookara has joined #lisp
Guest19180 has quit [Ping timeout: 272 seconds]
v_m_v has joined #lisp
rwcom8 has joined #lisp
rwcom has quit [Ping timeout: 260 seconds]
rwcom8 is now known as rwcom
refpga has joined #lisp
shangul has quit [Ping timeout: 265 seconds]
oxum has quit [Ping timeout: 265 seconds]
gko_ has quit [Ping timeout: 265 seconds]
drl has joined #lisp
v_m_v has quit [Remote host closed the connection]
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
jprajzne has quit [Quit: jprajzne]
rumbler31 has joined #lisp
jprajzne has joined #lisp
rumbler31 has quit [Ping timeout: 265 seconds]
ebzzry has quit [Read error: Connection reset by peer]
Nilby has left #lisp ["👽愛🆑"]
shifty has quit [Ping timeout: 252 seconds]
shifty has joined #lisp
Guest19180 has joined #lisp
Guest19180 has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
shka_ has quit [Read error: No route to host]
jprajzne has quit [Quit: jprajzne]
shka_ has joined #lisp
shka_ has quit [Client Quit]
shka_ has joined #lisp
varjag has joined #lisp
EvW1 has quit [Ping timeout: 272 seconds]
ebrasca has joined #lisp
jprajzne has joined #lisp
taichi has joined #lisp
ebzzry has joined #lisp
adriano1 has quit [Ping timeout: 265 seconds]
hhdave has quit [Quit: hhdave]
asarch has joined #lisp
<asarch> Any library for datum (i.e. to add 10 days from now)?
<sjl> local-time?
<asarch> Thank you! :-)
adriano1 has joined #lisp
jprajzne has quit [Quit: jprajzne]
asdf_asdf_asdf has joined #lisp
smazga has quit [Ping timeout: 265 seconds]
davepdotorg has quit [Remote host closed the connection]
smazga has joined #lisp
Guest19180 has joined #lisp
jprajzne has joined #lisp
oxum has joined #lisp
gareppa has joined #lisp
ebrasca has quit [Remote host closed the connection]
ebrasca has joined #lisp
varjag has quit [Ping timeout: 265 seconds]
Guest19180 has quit [Ping timeout: 265 seconds]
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
asdf_asdf_asdf has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 248 seconds]
jprajzne has quit [Quit: jprajzne]
clothespin has joined #lisp
FreeBirdLjj has joined #lisp
aeth has quit [Ping timeout: 268 seconds]
cosimone has joined #lisp
aeth has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
asdf_asdf_asdf has joined #lisp
FreeBirdLjj has quit [Ping timeout: 268 seconds]
<frodef`> Does anyone know what are the conditions for a compiler-macro to be used in sbcl?
oxum has quit [Ping timeout: 265 seconds]
gareppa has quit [Quit: Leaving]
Guest19180 has joined #lisp
<Bike> I think it pretty much always uses them, barring the standard stuff like notinline
Guest19180 has quit [Ping timeout: 265 seconds]
<Bike> i mean, as long as it is compiling
oxum has joined #lisp
<Bike> so if you just have (my-fun ...) in the repl a compiler macro on my-fun probably won't fire
Fare has quit [Ping timeout: 268 seconds]
<pfdietz> If the compiler macro has keyword args, but the call does not have a constant expression there, it will whine and not expand it.
<pfdietz> Trying to expand anyway in that case makes CCL erroneously fail.
<Bike> yeah that's annoying to deal with
<asdf_asdf_asdf> pfdietz, I don't know. Maybe it (SB-C::COMPILER-MACRO-ARGS (list 'compiler-macro)) => NIL.
swills has quit [Read error: Connection reset by peer]
william1_ has joined #lisp
swills has joined #lisp
<asdf_asdf_asdf> (apropos "compiler-macro") ; list of compiler macro symbols/functions
FreeBirdLjj has joined #lisp
asarch has quit [Quit: Leaving]
rwcom5 has joined #lisp
rwcom has quit [Ping timeout: 268 seconds]
rwcom5 is now known as rwcom
slyrus_ has joined #lisp
femi has quit [Ping timeout: 268 seconds]
Guest19180 has joined #lisp
FreeBirdLjj has quit [Ping timeout: 268 seconds]
FreeBirdLjj has joined #lisp
slyrus has quit [Ping timeout: 265 seconds]
jonatack has joined #lisp
FreeBirdLjj has quit [Ping timeout: 240 seconds]
pvaneynd_ has quit [Ping timeout: 245 seconds]
oxum has quit [Ping timeout: 265 seconds]
pvaneynd has joined #lisp
Guest19180 has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #lisp
frodef` has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Ping timeout: 268 seconds]
ebzzry has quit [Ping timeout: 268 seconds]
brown121408 has joined #lisp
rippa has joined #lisp
Solenoid_Snake has quit [Ping timeout: 268 seconds]
FreeBirdLjj has joined #lisp
william1_ has quit [Ping timeout: 268 seconds]
<jmercouris> is there an elisp to cl compiler?
mercourisj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 272 seconds]
shifty has quit [Ping timeout: 260 seconds]
shifty has joined #lisp
adriano1 has quit [Ping timeout: 260 seconds]
<Bike> i kinda doubt it? i mean probably most elisp is tied to the emacs environment, no?
<mercourisj> I assume so, no idea
<mercourisj> not sure how much of that environment could be emulated in some sort of runtime
<mercourisj> i mean all of it could
<mercourisj> but, how feasibly
jmercouris has quit [Disconnected by services]
mercourisj is now known as jmercouris
<jmercouris> I know that elisp people have some sort of "cl" library
brown121408 has quit [Ping timeout: 268 seconds]
<Bike> yeah that provides some common lisp operators and stuff
FreeBirdLjj has joined #lisp
brown121407 has joined #lisp
v_m_v has joined #lisp
oxum has joined #lisp
FreeBirdLjj has quit [Ping timeout: 260 seconds]
pvaneynd has quit [Ping timeout: 245 seconds]
jprajzne has joined #lisp
FreeBirdLjj has joined #lisp
davepdotorg has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
dale_ has joined #lisp
dale_ is now known as dale
dyelar has quit [Remote host closed the connection]
pvaneynd has joined #lisp
jprajzne has quit [Client Quit]
brown121407 has quit [Read error: Connection reset by peer]
dyelar has joined #lisp
jprajzne has joined #lisp
shifty has quit [Ping timeout: 260 seconds]
brown121408 has joined #lisp
akoana has joined #lisp
davepdotorg has quit [Ping timeout: 268 seconds]
Fare has joined #lisp
ggole has quit [Quit: Leaving]
msk has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Ping timeout: 265 seconds]
slyrus has joined #lisp
slyrus_ has quit [Ping timeout: 240 seconds]
efm has quit [Read error: Connection reset by peer]
cosimone has quit [Quit: Terminated!]
oxum has quit [Ping timeout: 240 seconds]
jmercouris has quit [Remote host closed the connection]
nirved has quit [Ping timeout: 272 seconds]
efm has joined #lisp
nirved has joined #lisp
slyrus_ has joined #lisp
izh_ has joined #lisp
pvaneynd has quit [Ping timeout: 248 seconds]
EvW has joined #lisp
cartwright has quit [Remote host closed the connection]
slyrus has quit [Ping timeout: 265 seconds]
cartwright has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
slyrus__ has joined #lisp
asdf_asdf_asdf has quit [Quit: asdf_asdf_asdf]
slyrus_ has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #lisp
slyrus__ has quit [Ping timeout: 260 seconds]
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
Dovahkiin has joined #lisp
FreeBirdLjj has quit [Ping timeout: 265 seconds]
<Dovahkiin> hey, uh
<Dovahkiin> Sometimes ppl in discord are busy, so I came here seeking for help)
<Dovahkiin> anyone here?)
<Bike> yeah you can go ahead and ask
philadendrite has quit [Remote host closed the connection]
<Dovahkiin> cool just didn't want to talk to the void)
<Dovahkiin> soo
philadendrite has joined #lisp
<Dovahkiin> I have a macro that takes some arguments and does stuff with them
<Dovahkiin> and inside a macro (but outside of `) I have an assertion
<Dovahkiin> that is supposed to throw some particular error if
<Dovahkiin> well, if some list is of the wrong length
jprajzne has quit [Client Quit]
<Xach> Ok!
<Dovahkiin> now, if I just put that macro in my repl and give it wrong data
<Dovahkiin> it throws the proper error
<Dovahkiin> and everything os cool
<Dovahkiin> however
<Dovahkiin> if I put it inside of a handler case
<Dovahkiin> that is supposed to catch that error and
<Dovahkiin> do something about it
<Dovahkiin> it doesn't do that
<Dovahkiin> and it says that instead it catches
<Xach> Runtime vs. macroexpansion time.
<Bike> you can write more than ten words on each line, it's cool. So the macro itself signals the error, not the code it expands into?
<Dovahkiin> `SB-INT:COMPILED-PROGRAM-ERROR`
<Dovahkiin> well
<Dovahkiin> yes, this
<Dovahkiin> I mean, the code it expands to
oxum has joined #lisp
<Bike> Maybe you could post the macro? On a pastebin or something.
<Dovahkiin> is not even supposed to signal the error, that error should be caught like, on macroexpansion
<Dovahkiin> well lemme try)
<Dovahkiin> this thing doesn't have inline code?
<Bike> But it sounds like Xach is right: the problem is that the handler-case covers the runtime but is not in effect while the macro is being expanded.
<Dovahkiin> yeah, that was actually my conclusion too
<Bike> It's annoying to get a bunch of lines at once is all.
<Dovahkiin> buut umm
<Dovahkiin> Can I somehow deal with that?
<Bike> So for example if you had (defmacro foo () (error "test")) and then in your repl did (handler-case (foo) (error (e) e)) you'd have a similar situation.
<Dovahkiin> Like, is it actually possible to catch an error from macroexpansion time?
<Xach> Dovahkiin: how do you want to handle the error?
<aeth> Dovahkiin: in the macro
<Bike> Well, it's possible to handle the error at the time when the code is being compiled
<Bike> but not at runtime, since at that point the macroexpansion is already finished
<Dovahkiin> nothing very smart - I just want to type its description and then automatically abort
<Dovahkiin> yeah, I am cool with putting that handler-case somewhere else -- the question is where
<Bike> Well I'm talking about like (handler-case (compile ...) ...) which is a bit unnatural.
<Dovahkiin> oof
<Bike> And also might not work since the compiler can intercept errors.
<Bike> You could have your macro detect the problem itself and expand into code which will signal an error at runtime, and perhaps additionally signal a warning at macroexpansion time.
<aeth> that's how I'd do it
<Dovahkiin> oh this
<Dovahkiin> this I was trying to do too
<Dovahkiin> the problem is that
<Dovahkiin> okay you know what
<Dovahkiin> I m gonna actually do something to show the code now
<Dovahkiin> its becoming too abstract
<aeth> If I'm writing a difficult macro, I don't do anything in the macro itself. I use helper functions for literally everything, and just eval-when those functions or put them in a separate file so they're available to the macro. In that case, a HANDLER-CASE would be the only thing in the DEFMACRO body itself that's not a trivial function call.
milanj has joined #lisp
jprajzne has joined #lisp
<Dovahkiin> hm
<Dovahkiin> wait a sec
<Dovahkiin> is this a suggestion
<Dovahkiin> to put handler case in the macro too?0
<Bike> More like to put it in the macro only.
<Dovahkiin> umm
<Bike> I mean, if the macro itself runs into the problem, that's not a runtime error, it's a syntax error. The code is wrong.
<Dovahkiin> actually it kinda worked
<Dovahkiin> what I said
<Dovahkiin> but maybe its the same what you said
<Dovahkiin> it looks a bit stupid now since its like
<Dovahkiin> handler case around assert
<Dovahkiin> buuut
<Dovahkiin> it does work so I am cool with it
<Dovahkiin> thanks a lot
<aeth> Dovahkiin: Although you could have your macro expand to generate an error at runtime if it encounters an error at macro expansion time instead of failing. SBCL does something similar with type errors. Your function will run, it'll just have a runtime type error
<aeth> As in, SBCL compiles your function to literally always have an error.
<Dovahkiin> right, this I know
jprajzne has quit [Client Quit]
<Dovahkiin> but I really didn't want to generate that assertion because well
<Dovahkiin> it seemed like it decided it will eval some other code first
<Dovahkiin> and its illigal to eval it if that assertion fails
<Bike> It's kind of hard to follow what you're saying without seeing the code. handler-case around assert sounds kind of pointless, though. Why not just write (unless assert-condition-here ...)?
<aeth> Bike: the assert could be deep in the macro body (or a helper function) while the handler-case could be at the very top, that's the only reason why
<Bike> fair
<aeth> Dovahkiin: In case I'm unclear, if you want a runtime error, you would just catch the ASSERT and setup your macro body such that it returns something like `(error "Yeah, this failed.") in the case of the ASSERT being caught, instead of the normal expansion
<aeth> Or, alternatively, do the check at the very beginning and put a branch there.
<aeth> (Instead of asserting at all)
fookara has quit [Remote host closed the connection]
<aeth> Dovahkiin: well, you'd probably also want a macro-time WARN so it's not a complete surprise
<aeth> so e.g. (progn (warn "Yeah, this failed.") `(error "Yeah, this failed."))
<Dovahkiin> okay, I will put this a the refactor note. The macro is very long, so for example putting the branch in thebeginning is not the option
manualcrank has quit [Ping timeout: 268 seconds]
<Dovahkiin> I make my assertion inside a loop
<Dovahkiin> and there will be more different ones
<aeth> If a macro is more than 30-40 lines, it's probably best to split it into macro-expansion-time functions.
<Dovahkiin> returning an error seems...
<Dovahkiin> hmm
<Dovahkiin> okay
<Bike> detecting and reacting to a compile time syntax error at runtime is just kind of weird is all.
<aeth> To call a function from a macro, it should be either wrapped in EVAL-WHEN (everyone just uses the full "(:compile-toplevel :load-toplevel :execute)" for that) or it should be in a file that's previously loaded. Most people prefer the latter because then the functions stay at the top level, with the disadvantage of not being in the same file anymore.
<aeth> And imo pretty much any large macro is more readable with helper functions because now it's just a bunch of list processing functions
<aeth> Bike: I've never done it, it is possible, though.
<Bike> but why would you want to
<Dovahkiin> well this whole project is a bit weird in a sense because it is supposed to be used with repl
<Dovahkiin> its not supposed to be an executable at anypoint
gravicappa has quit [Ping timeout: 260 seconds]
<Bike> that's reasonably common
izh_ has quit [Quit: Leaving]
jfb4 has quit [Read error: Connection reset by peer]
Guest19180 has joined #lisp
frodef has joined #lisp
<aeth> Bike: This is probably a bit of a stretch, but consider the case of generating GLSL shaders from a macro where you're expected to be recompiling it repeatedly as you modify your program. A macro-generated error would mean, "This didn't work, but continue as usual with the current, cached shader." So catching that at runtime would mean that it only impacts a fresh start.
<aeth> Or something...
<aeth> You'd only really need to see a WARN since there's nothing you can do if you make a bad modification. The debugger would just get in the way.
manualcrank has joined #lisp
Guest19180 has quit [Ping timeout: 268 seconds]
<frodef> oh my.. I did indeed have notinline declamation. sigh. sorry.
oxum has quit [Ping timeout: 272 seconds]
rwcom4 has joined #lisp
FreeBirdLjj has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
swills has quit [Read error: Connection reset by peer]
narimiran has quit [Ping timeout: 245 seconds]
rwcom has quit [Ping timeout: 265 seconds]
rwcom4 is now known as rwcom
visage_ has joined #lisp
asdf_asdf_asdf has joined #lisp
visage_ has quit [Client Quit]
theruran has quit [Quit: Connection closed for inactivity]
v1sage has joined #lisp
refpga has quit [Remote host closed the connection]
swills has joined #lisp
z147 has joined #lisp
dddddd has joined #lisp
u0_a121 has joined #lisp
FreeBirdLjj has quit [Ping timeout: 265 seconds]
jprajzne has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
shka_ has quit [Ping timeout: 248 seconds]
Bike has quit [Quit: Bike]
vlatkoB has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
wsinatra has quit [Quit: WeeChat 2.7]
v1sage has quit [Quit: v1sage]
varjag has joined #lisp
<pjb> minion: memo for jmercouris: there's some emacs lisp compatibility code in Hemlock.
<minion> Remembered. I'll tell jmercouris when he/she/it next speaks.
<pjb> minion: memo for jmercouris: my plan is to write a C compiler targetting CL, to specifically compile GNU emacs in a lisp image ;-)
<minion> Remembered. I'll tell jmercouris when he/she/it next speaks.
<pjb> minion: memo for jmercouris: there's a CL implementation in emacs lisp: emacs-cl; but it has bitrotten, since it worked before the introduction of closures in emacs lisp.
<minion> Remembered. I'll tell jmercouris when he/she/it next speaks.
davepdotorg has joined #lisp
FreeBirdLjj has joined #lisp
oxum has joined #lisp
<pjb> Dovahkiin: during macro expansion, it's probably better to generate program-error than just error conditions…
malfort has quit [Ping timeout: 265 seconds]
malfort has joined #lisp
FreeBirdLjj has quit [Ping timeout: 265 seconds]
<pjb> Dovahkiin: for example: (defmacro moo (l) (unless (and (listp l) (evenp (length l))) (error 'alexandria:simple-program-error :message "Macro ~S argument must be a list with even number of elements, not ~S" 'moo l)) `(list ,@(mapcar (lambda (x) `',x) l)))
davepdotorg has quit [Ping timeout: 272 seconds]
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
<pjb> Dovahkiin: sorry, it's: (defmacro moo (l) (unless (and (listp l) (evenp (length l))) (alexandria:simple-program-error "Macro ~S argument must be a list with even number of elements, not ~S" 'moo l)) `(list ,@(mapcar (lambda (x) `',x) l)))
u0_a121 has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
malfort has quit [Ping timeout: 265 seconds]
Ven`` has joined #lisp
rumbler31 has joined #lisp
pfdietz has quit [Remote host closed the connection]
jprajzne has quit [Quit: jprajzne]
xuxuru has joined #lisp
FreeBirdLjj has quit [Ping timeout: 268 seconds]
Ven`` is now known as Ven_de_Thiel
rumbler31 has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #lisp
asarch has joined #lisp
FreeBirdLjj has quit [Ping timeout: 260 seconds]
<asarch> What would be the purpose of the symbol data type?
varjag has quit [Ping timeout: 240 seconds]
oxum has quit [Ping timeout: 268 seconds]
EvW has quit [Ping timeout: 245 seconds]
Bike has joined #lisp
<frodef> asarch: a convenient way to designate identity.
<aeth> asarch: As I said yesterday, (eq 'foo 'foo) => T but (eq "foo" "foo") is not necessarily T, and probably NIL
<aeth> asarch: You don't want to have to do a string= or string-equal (the latter is case-insensitive) or equalp (which just uses string-equal iirc) because that will at the best case return NIL right away (e.g. "a" vs. "b") and at the worst case be O(n) instead of O(1) for EQ/EQL on symbols
<aeth> Many languages use some fancy immutable strings to get around this, but in CL, strings are mutable (although literal strings like "foo" are unwise to modify and thus are de facto immutable... just without the strong guarantees of actually being immutable).
<aeth> So you wind up with a situation where in CL you're using symbols (and probably keywords, like :foo) where in other languages you'd use immutable strings. Sort of as an enum-equivalent.
<Odin-> The actual explanation involves a lot of history.
Fare has quit [Ping timeout: 268 seconds]
<aeth> It baiscally comes down to, in some languages you use enums (either literally an enum type, or by defining globals that are associated with numeric constants), in some languages you use immutable strings (so "foo" == is_this_foo is cheap and will always work for "foo"s), and in some languages you use something like CL's symbols/keywords, and CL falls in the third camp most of the time (sometimes you do need more enum-like constructs)
<aeth> s/baiscally/basically/
<aeth> If you have never seen one of the three (often with some case-like construct or a bunch of if/then/elses), you need to program more and read more programs because it's common to need an internal name for things
<aeth> e.g. (let ((foobar :foo)) (case foobar (:foo "Hello") (:bar "Hi") (t "Greetings"))) ; a keyword like :foo is just a symbol in the keyword package, with the syntactic sugar of being able to say :foo instead of 'keyword:foo
Fare has joined #lisp
<aeth> in another language, it might be FOO and BAR, or "foo" and "bar", but in CL, you usually use keywords (effectively symbols that are "aren't" namespaced, even though they're technically namespaced in the keyword package)
<aeth> If you're used to languages with enums, you can think of keywords like enums whose number you can't access, except that the number is the memory location of the keyword argument, rather than the compiler implicitly doing 0, 1, 2, 3, ...
<aeth> If you're used to languages with immutable strings, you can think of the keyword :foo as immutabilifying the string "FOO"
theruran has joined #lisp
sauvin_ has joined #lisp
jmercouris has joined #lisp
efm has quit [Read error: Connection reset by peer]
oxum has joined #lisp
pnp has joined #lisp
EvW has joined #lisp
sauvin has quit [Ping timeout: 265 seconds]
sauvin_ is now known as Sauvin
efm has joined #lisp
sjl_ has quit [Ping timeout: 265 seconds]
woozong has joined #lisp
Guest19180 has joined #lisp
Guest19180 has quit [Ping timeout: 265 seconds]
LiamH has quit [Quit: Leaving.]
<pjb> asarch: symbols are used as identifiers in lisp programs. Since lisp gives the programmers a mean to process the lisp program, it must give a way to represent identifiers, so user programs may manipulate lisp programs (eg. with macros).
<pjb> asarch: historically, lisp was invented to do AI, and it was thought that AI implied some introspection. Therefore it was important for lisp programs to be able to manipulate lisp programs, including the names in the lisp programs.
jprajzne has joined #lisp
EvW has quit [Ping timeout: 248 seconds]
<pjb> asarch: The interning is not particularly essential (you can create uninterned symbols with make-symbol, or reading them with #:). It's obviously useful to intern the symbols into the symbol-table of your program (what we call package in Common Lisp). But if you have a use for symbols beyond that, you will in general ignore or avoid interning.
<pjb> asarch: on the other hand, you may need in a program to intern other objects, such as strings.
Fare has quit [Ping timeout: 260 seconds]
EvW has joined #lisp
jprajzne has quit [Quit: jprajzne]
rwcom8 has joined #lisp
<pnp> how is typically defined the constant t in CL?
oxum has quit [Ping timeout: 260 seconds]
rwcom has quit [Ping timeout: 268 seconds]
rwcom8 is now known as rwcom
jprajzne has joined #lisp
<Bike> t's value is always itself
<terpri> pnp, (defconstant t 't)
<Bike> what are you asking about exactly
<pnp> because i get back no known definition for: t
<aeth> pnp: it's CL:T
<asdf_asdf_asdf> T names the system-class #<SB-PCL:SYSTEM-CLASS COMMON-LISP:T>:
<pjb> pnp: probably you are in a package that you have defined without using the CL package.
<aeth> you can always (defpackage #:foo) ; notice how it doesn't (:use #:cl) like is normal
<pjb> NO!
<aeth> and then FOO:T won't be found, and T won't be found if you (in-package :foo)
<pjb> (defpackage #:foo) is IMPLEMENTATION DEPENDENT.
<asdf_asdf_asdf> Always You should type (describe 't).
<pjb> You don't know what package are used when you do (defpackage #:foo)!!!
<pjb> Therefore NEVER DO (defpackage #:foo)!!!
<pjb> You should always have a (:use …) option!!!
<aeth> pjb: oh? it can implicitly :use #:cl?
<aeth> okay then
<pjb> It may or may not!
<aeth> (defpackage #:foo (:use))
<pjb> This is what IMPLEMENTATION DEPENDENT means.
<aeth> It's so unusual to use nothing, anyway.
<pjb> Not really.
<pjb> User packages often don't use anything. You use them only to intern your user symbols.
<asarch> Thank you guys
<asarch> Thank you very much
v_m_v has quit [Ping timeout: 272 seconds]
martink has joined #lisp
<aeth> Anyway, T itself depends on the implementation. Obviously "SB-PCL" in asdf's answer is SBCL-specific.
martink has quit [Remote host closed the connection]
<pjb> pnp: note you can define your own T symbol, not eq to CL:T, and it will mostly work, because any lisp object that is not CL:NIL will be true. There are a few places where CL:T itself is expected, but it's rare enough.
<aeth> Generally, CL:T is expected when the type boolean is expected, but when types aren't involved, any generalized boolean will do
<pjb> pnp: on the other hand, you cannot define your own NIL symbol, since nil is used everywhere to mark the end of list.
<pjb> pnp: if you defined your own nil, you would have to re-implement about all the CL functions…
<pjb> pnp: also, you may use: (com.informatimago.tools.symbol:check-duplicate-symbols) to check different symbols with same name in different packages…
xuxuru has quit [Quit: xuxuru]
<pjb> For example, currently in my image, I have a symbol named "T" in COMMON-LISP and another one in KEYWORD… cl:t and :t
woozong has quit [Ping timeout: 260 seconds]
davepdotorg has joined #lisp
davepdotorg has quit [Ping timeout: 240 seconds]
jprajzne has quit [Quit: jprajzne]
Guest19180 has joined #lisp
jprajzne has joined #lisp
v_m_v has joined #lisp
oxum has joined #lisp