phoe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.16, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
pierpal has joined #lisp
techquila has quit [Ping timeout: 255 seconds]
techquila has joined #lisp
_whitelogger has joined #lisp
rozenglass has quit [Remote host closed the connection]
pierpal has quit [Ping timeout: 250 seconds]
t58 has quit [Quit: Night]
ebrasca has quit [Remote host closed the connection]
Kundry_Wag has quit [Read error: Connection reset by peer]
Kundry_Wag has joined #lisp
smasta has quit [Ping timeout: 246 seconds]
_whitelogger has joined #lisp
akoana has left #lisp [#lisp]
CuriousCain has quit [Quit: WeeChat 2.2]
asarch has joined #lisp
deng_cn has quit [Ping timeout: 246 seconds]
orivej has quit [Ping timeout: 246 seconds]
rumbler31 has joined #lisp
ltriant has joined #lisp
refpga has quit [Remote host closed the connection]
ltriant has quit [Ping timeout: 255 seconds]
igemnace has quit [Quit: WeeChat 2.4]
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 244 seconds]
torbo has joined #lisp
clintm has joined #lisp
sjl_ has joined #lisp
sjl_ has quit [Client Quit]
nulquen has quit [Quit: nulquen]
refpga has joined #lisp
<fiddlerwoaroof> Are there any rules about defining methods on MAKE-INSTANCE besides the usual "only define a method if you defined either the generic function or the class"?
<fiddlerwoaroof> I don't see anything in the obvious places in CLHS
<refpga> Hi, Paul Graham, in ANSI Common Lisp, mentions that in some lisp implementations, consing is faster than not consing (destructive). Any ideas which implementations is he talking about?
<beach> Good morning everyone!
<pjb> fiddlerwoaroof: it's rare to have to define a method on make-instance. Usually you add methods on shared-initialize or initialize-instance instead.
<LdBeth> Morning
<pjb> refpga: it's easy to do faster: creating a new cons is very fast. Just increment a freeheap pointer. That's it.
<refpga> Sorry, I'm referring to the part where he says that (in some implementations) "it's faster to cons up new objects & throw them away, than it is to recycle them".
<beach> fiddlerwoaroof: I don't think there is any rule beyond the general one.
<beach> refpga: I don't think it is easy to find such an implementation.
<refpga> I was hoping somebody here could give me at least a name. :D
<beach> I take that statement to mean "Don't be afraid to allocate memory. It is not as expensive as it would be if you program in a language with manual memory management."
<beach> And that one is definitely true if your Common Lisp system has a reasonably good garbage collector.
<p_l> consing when newly allocated memory won't go above current high water mark tends to take single, if a bit expensive, instruction
<p_l> (the rest is initialization)
<asarch> Since there were Lisp machines… one could say that Lisp is actually a low-level programming language, right?
<p_l> asarch: depends how you define level
<beach> p_l: but how can a single instruction be faster than no instruction?
<p_l> beach: reuse of an object typically is not zero instructions
<beach> I mean, I know that it has to do with cache pollution and stuff like that.
<p_l> beach: but a much longer reset find-clean-initialize sequence
<beach> asarch: Definitions like that are meaningless.
<asarch> I see
<p_l> a good definition for "low-level language" I've heard is that a low level language makes you think and worry about things unrelated to your task
<oni-on-ion> 'bare metal' ? or 'close to the metal'
<beach> asarch: Why do you need to know?
<oni-on-ion> considering there may not be a 'lower' level than lisp for lisp machines, i'd say its the lowest.
<asarch> I just was thinking about the golden time of Lisp: https://en.wikipedia.org/wiki/Lisp_machine
<p_l> beach: usually, the time involved in taking an object from freelist with apropriate bookkeeping is longer than single compare-and-swap operation (or even single addition) to which allocation in many GC systems boils down to
<LdBeth> asarch: lisp machine is programmed in micro code
<beach> p_l: You are assuming many things here.
<p_l> LdBeth: so is x86
<beach> p_l: Let's take a simpler example...
<LdBeth> It doesn’t directly take s exps anyway
<beach> p_l: You want to replace the first element of a list.
<p_l> beach: the whole quote about reuse vs. consing is a gross generalization in fact
<asarch> And thinking about how different was that Lisp from nowadays Lisp
rumbler31 has quit [Read error: Connection reset by peer]
<beach> p_l: Do you do (setf (car list) ...) or (cons ... (cdr list)?
<oni-on-ion> asarch, seen? http://victor.se/bjorn/lispm.php
<p_l> asarch: MIT Lisp Machines and their descendants essentially exposed low-level instructions as primitive lisp functions, using which a lisp environment was built
rumbler31 has joined #lisp
<beach> p_l: You don't have to argue with me. I am just saying that it is hard to either confirm or deny such a statement since the context is not known.
<p_l> beach: SETF, of course. (there might be exceptions). That said, the generalization is mostly about a bit bigger objects and the visible and hidden costs to their reuse
<beach> p_l: The thing about "no instruction" is valid in some situations like the one I mentioned above.
<p_l> beach: I'm mostly trying to make it into a learning moment for refpga ;)
<beach> Good.
<p_l> replacing a primitive atom is one degenerate case. Reusing an object which has high initial setup cost but low "clear" cost is another
<beach> asarch: Not that different.
<p_l> Yet another case is having to ensure that you don't allocate new memory for different constraint
mindthelion has joined #lisp
<p_l> asarch: Lisp Machine Lisp, at least by ~1971, was vividly recognizable to a common lisper
<p_l> including packages
<asarch> Is there any of those old environments surviving nowadays?
<p_l> asarch: you can run MIT CADR with System version 78 in stable, albeit power hungry way
<LdBeth> Some people here have Symbolics Genera tuning in Linux
<beach> asarch: Not widely used.
dddddd has quit [Remote host closed the connection]
<p_l> there's mostly-stable but afaik not feature complete TI Explorer emulator (which derives from CADR through LMI Lambda)
<refpga> Thanks everyone.
<no-defun-allowed> Technically, OpenGenera and Symbolics machines are still sold today. (I also have a less legitimate OG virtual machine, but it is not very stable.) You can also run a CADR emulator freely.
<p_l> there's a working though afaik also incomplete LMI Lambda emulator
techquila has quit [Ping timeout: 250 seconds]
<p_l> There's Xerox Common Lisp environment (unrelated to MIT CADR)
<p_l> can be ran on Darkstar emulator
<p_l> there's OpenGenera, which is *incomplete* system for running the most famous Lisp Machine stuff on DEC Alpha
<beach> asarch: Why are you wondering about those environments?
<p_l> and there's a bunch of hacked up ports of OpenGenera to amd64 which work... somewhat
<p_l> (there's also surviving lisp machines, but most endup in hands of few people I know who tend to not share)
<asarch> Since the fist time I saw Street Fighter video game when I was 10 years I was stunned by the way the programmers did with few
<oni-on-ion> 1 or II?
<asarch> Just compare the specs from that old machine with a powerful PS4 or XBox
<asarch> 1
<no-defun-allowed> This (group of people? person?) person has a few Lisp Machines, as well as other esoteric machine
<no-defun-allowed> This (group of people? person?) person has a few Lisp Machines, as well as other esoteric machines: https://www.instagram.com/p/Bwfj0wSFlzK/
<p_l> yeah, and they are vehemently not sharing :)
<beach> asarch: Are you hinting that the old environments were more efficient than what we do today?
<asarch> In that sense, Lisp is a programming language that you can do a lot with few
<asarch> Yeah!
<p_l> that's from a recent emergency rescue
<asarch> Wow! Nice picture!
<oni-on-ion> more efficient at what? afaik lispM had no network stack
<beach> asarch: That is definitely not the case. If you see videos of a Symbolics Lisp Machine, you will notice that it is extremely slow compared to SBCL on a modern PC.
<beach> asarch: And that is on specialized hardware.
<oni-on-ion> perhaps the metanostalgia is for the focus of a pony of one trick. me i've got that for MS-DOS days, and some Win3.1
<beach> asarch: You can imagine how slow it was on stock hardware.
<p_l> asarch: Symbolics lisp machines were, for a time, "superpowerful" workstations in a time when most people wouldn't get more than serial terminal on their desk
<beach> asarch: We have made much progress on compiler technology and automatic memory management.
<beach> asarch: So you can stop pining for the old environments.
<no-defun-allowed> I think asarch could be referring to the development environments, not so much the compiler or hardware.
<p_l> beach: well, I think we managed less *waste* of the capability we had
<p_l> unlike these days
<p_l> and I don't mean stuff wasted on making it easier to program or more comfortable
<no-defun-allowed> I skimmed a copy of the Interlisp manual, and it seemed quite featureful.
<beach> Yes, we are still a few years away from something better than Genera.
<p_l> asarch: btw, there are some low-key efforts to bring a more viable way of interacting with Genera to the masses
<no-defun-allowed> (The person I linked to told me he was considering setting up some kind of remote interface for his lispm collection too.)
<p_l> beach: also, I think that while people forget how painfully slow things used to be, there's a lot of worth in experiencing and learning the old things so that we better avoid reinventing the wheel
<oni-on-ion> asarch, check out CLIM
<p_l> no-defun-allowed: the owner of that account did mention possibly setting me up with remote access to an Ivory when I need to confirm things on physical hw vs my emulator, yes
<beach> p_l: Again, you don't have to argue with me. :)
<asarch> I'm learning CLIM!
moldybits has quit [Quit: WeeChat 2.4]
<p_l> beach: arguing? No way. But you have the best responses ;)
<beach> Heh.
<no-defun-allowed> asarch: the CLOSOS book may also be of use, though it covers more OS-level constructs like secondary storage and what can be shed off using a Lisp compiler: http://metamodular.com/closos.pdf
sjl has quit [Quit: WeeChat 2.2-dev]
notzmv has joined #lisp
notzmv is now known as Guest23267
<no-defun-allowed> p_l: I don't really have a use for a lispm other than to mess about, but I think he hinted it would be fairly public.
<fiddlerwoaroof> pjb, beach: thanks, I was asking because I've been thinking that defining methods on make-instance could be an interesting way of achieving some effects: like defining classes for forcing certain initargs to be present or to dynamically select the class that MAKE-INSTANCE produces
Guest23267 is now known as nozmv
nozmv is now known as zmv
<fiddlerwoaroof> It was just someting that occurred to me that I thought might be semi-interesting
<p_l> no-defun-allowed: I don't have full computing power to setup long term public access, but my goal is to get a petting zoo of emulated vintage machines that are all networked, including several lisp machines
<no-defun-allowed> Cool.
<beach> asarch: To summarize, Genera was no doubt a great development environment, albeit very slow. We now have hardware that is several orders of magnitude faster. We have better compiler technology and better memory management technology.
<beach> asarch: If we put in a little effort, we can create something much better than Genera in that it would be a safe multi-user environment, yet an excellent development environment and much faster.
zmv is now known as notzmv
<beach> fiddlerwoaroof: I see.
<p_l> beach: interestingly, never-realized development notes from Genera source mention a goal of porting it to generating native x86 code, which they estimated to provide lispm-level of performance on a 486 machine
<beach> Wow.
<fiddlerwoaroof> p_l: is the graphical environment built on X? or did it just have X support for unix-interoperability?
<no-defun-allowed> Did they say which machine would be comparable? I think the Alpha port was supposed to be about on par with their last lispm.
<p_l> no-defun-allowed: alpha depends on which alpha
<beach> asarch: So I am trying to think of ways of redirecting all the energy that is currently spent on FFI and Web programming to this effort, but I think that will be hard.
<asarch> If you were in charge to create a new Lisp box using nowadays hardware, how would you do that and why in that way?
<asarch> I mean, if all you
<fiddlerwoaroof> beach: the difficult part is convincing people to believe in the new system enough to switch everything at once
<beach> asarch: Exactly the way I am doing it.
<p_l> future-planned native Symbolics x86 compiler was supposed to make genera run on typical 486 (let's be nice and say 66MHz at speed comparable to last symbolics hw, XL1200)
<fiddlerwoaroof> FFI/Web programming have the advantage that you can work with things you already know while comming to appreciate the lisp environment
<beach> fiddlerwoaroof: Of course.
<no-defun-allowed> asarch: As in, with off the shelf components (x86_64 processors) or if we had access to fabbing and custom silicon?
<fiddlerwoaroof> And, the more I have to deal with other languages, the more I appreciate ASDF and Lisp's notion of image-based development
<fiddlerwoaroof> I hate having to throw away my app state just to try out a new library
<p_l> fiddlerwoaroof: Genera had its own "sheet" system, which derived from original CADR display system, with code to run it over X11 added at certain point (but not all software worked on X11 outputs)
<beach> asarch: I.e., use an ordinary modern PC. Write an excellent Common Lisp system for it with first-class global environments, a concurrent GC, etc. Then make it multi-user. Include CLIM, Clordane, Second Climacs and you are almost done.
aeth_ has joined #lisp
<no-defun-allowed> If the latter, I would probably choose to produce hardware that is closer to lispm hardware, but I am not sure if registers or a stack is better to work with. Either way, some hardware with better knowledge of high level constructs like types, procedure calls, etc would likely be better for everyone. This is an impossible dream though.
<p_l> you don't need much
<fiddlerwoaroof> no-defun-allowed: ultimately, I don't think the hardware route is all that viable
<asarch> What processor, Intel or AMD?
<p_l> some basic support for typing, preferably a way of representing forwarding pointers directly instead of through emulation, a generic mechanism for fast traps (for types and errors) and you're set
<no-defun-allowed> I think beach's idea of a CLOSOS on already-produced hardware is more viable since we don't have access to the processes required.
aeth has quit [Ping timeout: 255 seconds]
<beach> asarch: It doesn't matter. You need to start thinking about these things before you ask.
aeth has joined #lisp
<no-defun-allowed> asarch: Whichever is faster. x86_64 is mostly the same, give or take some extensions that differ.
<p_l> I attempted to give a talk about minimal high-level language machine where we don't end up implementing it in pseudo-microcode at ELS, but it bombed
<asarch> As far I know, Linux for example, runs better on Intel
<p_l> asarch: not really
<p_l> the amount of "it depends" is so great the question is not relevant
<asarch> In spite of that AMD is actually the inventor of the x86_64 platform
<beach> asarch: Please don't come up with such claims without some serious documentation, together with a definition of "better".
<no-defun-allowed> I think AMD's performance per dollar (and probably watt when 7nm rolls around) is better up to around the $1000 mark, but I am not too well researched.
<beach> asarch: And it's getting seriously off topic too.
<asarch> I know, I know and sorry for that
<no-defun-allowed> And again, this is irrelevant to Lisp OS design.
aeth_ has quit [Ping timeout: 246 seconds]
<no-defun-allowed> I would stuff whichever is more cost effective into a box, and then you probably have different price points to consider, then you should be wondering why if this is general hardware you need to sell your own machines.
moldybits has joined #lisp
ltriant has joined #lisp
<p_l> asarch: does not really matter
<beach> asarch: Please stop it.
<asarch> Ok, ok
<no-defun-allowed> It's a PC-architecture machine on a stick. Only the physical size is different.
<p_l> handling forwarding pointers with hw support is fun though. Makes a lot of GC easier
<no-defun-allowed> (Last thing I'll say on the topic: you may want to skim over Interim, a half-of-Scheme operating system that runs on Raspberry Pis: https://github.com/mntmn/interim It still seems like a traditional unixy system to me, but the language of choice is Scheme. It's like a gateway design into the more esoteric Lisp designs :)
aeth has quit [Ping timeout: 244 seconds]
ltriant has quit [Ping timeout: 244 seconds]
aeth has joined #lisp
q9929t has joined #lisp
rippa has joined #lisp
dmiles has quit [Ping timeout: 246 seconds]
Aruseus has quit [Remote host closed the connection]
q9929t has quit [Quit: q9929t]
anewuser has quit [Quit: anewuser]
varjag has joined #lisp
clintm has quit [Remote host closed the connection]
clintm has joined #lisp
<asarch> What is symmetry in Lisp?
<asarch> I cannot find the explanation of this in Wikipedia
<beach> asarch: You live in a strange world.
<asarch> (At least in the English version of Wikipedia)
<oni-on-ion> equations are symmetrical
lavaflow has quit [Read error: Connection reset by peer]
<beach> asarch: A world of undefined terminology that someone came up with and that you for some reason need to know how it applies.
<beach> asarch: Your time would be much better spent on things that have good definitions and that apply to Common Lisp.
<oni-on-ion> does he mean homoiconic ?
<asarch> I'm confused at the symmetry and Homoiconicity definitions
lavaflow has joined #lisp
<oni-on-ion> asarch, wiki has a full page on it. basically means the language is written in itself
APic has quit [Ping timeout: 255 seconds]
<beach> A language can not be written in itself. A language is in fact not written in anything at all.
<beach> A language is a specification of the valid phrases that a language processor must accept and of the consequences of submitting invalid phrases to it.
dmiles has joined #lisp
<oni-on-ion> conjecture
<beach> Now a language processor for some language may of course be written in the same language that it processes.
<asarch> I mean, I would understand Homoiconicity like the ability to store snapshots of the current process
<no-defun-allowed> Lisp is naturally symmetrical, since you can write (+ 2 +) and it is a valid program (provided you bind + to a number)
<oni-on-ion> asarch, nahhh thats more like VM.
<oni-on-ion> or they say 'image-based'
<beach> no-defun-allowed: Heh, nice!
<oni-on-ion> eww. i'd say lisp if fully asymmetric. the trees flow from left to right, from out to in
<no-defun-allowed> I cannot think of more palindromes in Lisp though...
<beach> asarch: You would understand wrong.
<oni-on-ion> otherwise we would have our lisp code aligned in the center, going left or right
<oni-on-ion> all language is umm serial, streamed from A to Z. something like Prolog is a bit different however, where functions can be run backward and forward.
<asarch> From the Land of Lisp book: "A programming language that uses the same data structures to store data and program code is called homoiconic"
<oni-on-ion> asarch, yep thats what it says here : https://en.wikipedia.org/wiki/Homoiconicity
<oni-on-ion> (sorry i thought that homoiconic and symmetry were related somehow) not sure how you get all these terms mixed up with each other, asarch
<asarch> "You have seen that Lisp has very elegant and symmetrical facilities for translating raw strings data from the outside world and converting it to and from Lisp syntax expressions."
<asarch> "But Lisp has an even deeper symmetry. It can treat program code and data interchangeably"
<no-defun-allowed> Ooh, here's a better palindrome: (cons 'Hello-olleH' snoc)
<asarch> That paragraph is killing on me
<no-defun-allowed> asarch: That's one way to describe homoiconicity without seven-syllable words.
<beach> asarch: I have news for you. Authors of books also use undefined terminology.
APic has joined #lisp
<no-defun-allowed> Generally authors avoid seven-syllable words closer to the start of their beginner books.
<asarch> I mean, if I store: (format t "Lisp is symmetry") on a file and the I re-read it and eval it, is that symmetry?
<LdBeth> For example, what is lexical macro
<LdBeth> asarch: no
<asarch> The one it exists locally
vlatkoB has joined #lisp
<asarch> Or, symmetry means well-balanced parenthesis?
<no-defun-allowed> The Lisp reader wouldn't like unbalanced parentheses.
<no-defun-allowed> But that's not a feature specific to Lisp.
<oni-on-ion> beach =)
<LdBeth> It is about the parser accepts exactly the printed representation of data
<oni-on-ion> then, eating food and using the commode is symmetry
meepdeew has quit [Remote host closed the connection]
_whitelogger has joined #lisp
<asarch> Anyway, (bed-time)
<no-defun-allowed> oni-on-ion: i would not eat what is created from the second part
<no-defun-allowed> the Lisp reader absolutely would though
<asarch> BTW, one last question: in some programming languages you can create "chained actions" like: foo.bar().baz("spam");
<pjb> (eval-when (:bed-time) (sleep #.(* 8 60 60)))
<asarch> Can you do the same with CLOS? (baz (bar (foo)) "spam")?
<pjb> Of course. You just did it!
<no-defun-allowed> Pull up some arrow macro if you don't want to nest them. (-> foo bar (baz "spam"))
* asarch takes notes...
<pjb> asarch: there's little point of doing that in CL.
<no-defun-allowed> I think (<- (baz "spam") bar foo) suits Lisp's prefix tendency better though. Either one is trivial to write.
<asarch> How do you eval self (in order to return it) when you define the (defmethod ...)'s?
xkapastel has joined #lisp
<pjb> If you translate the pattern in CL: (defclass foo () ()) (defclass bar () ()) (defclass baz () ()) (defmethod bar ((f foo)) (make-instance 'bar)) (defmethod baz ((b bar) string) (make-instance 'baz)) (baz (bar (make-instance 'foo)) "spam") #| --> #<baz #x30200265E86D> |#
<pjb> the trick of this pattern is to have additionnal classes to answer to the "chained" methods.
<asarch> Thank you!
<pjb> In the best case, the they can be the same class so you can just return self.
<pjb> But often you can't.
<pjb> In CL, it is better to either write a macro, or just to use a multi-argument function.
<asarch> Ok
<asarch> I just was wondering about it because I still cannot set the (glut:motion-func ...) callback
<pjb> (defmethod bar ((self foo)) self) (defmethod baz ((self foo) string) self) (baz (bar (make-instance 'foo)) "spam") #| --> #<foo #x3020026DEA1D> |#
<oni-on-ion> asarch, "partial evaluation" and "currying"
<oni-on-ion> ie. (+ 1 _) == (lambda (x) (+ 1 x))
<beach> asarch: When the author writes "symmetry" here, he means "good stuff". And "symmetric" means "really good".
<asarch> ...
<asarch> I see
<asarch> Thank you guys!
<asarch> Thank you very much :-)
<asarch> See you later
<asarch> Have a nice day!
asarch has quit [Quit: Leaving]
angavrilov has joined #lisp
ggole has joined #lisp
rumbler31 has quit [Read error: Connection reset by peer]
rumbler31 has joined #lisp
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
<no-defun-allowed> So, I am trying to write a small abstraction for "sequences" for a DSL I am making. I would like to make it so that SUBARRAY replaces indices that are NIL with the start or end of the sequence, but without requiring client code to handle those cases. I tried to use the :around method combination to handle these cases, but it does not get called, nor does it appear in the list created by COMPUTE-APPLICABLE-METHODS.
<no-defun-allowed> Here is the relevant code: https://plaster.tymoon.eu/view/1322 Am I using :around wrong? What have I done?
defaultxr has quit [Ping timeout: 246 seconds]
<no-defun-allowed> Eh well, it is not appropriate for the base library. I will just change the function the DSL gets to use.
gravicappa has joined #lisp
<beach> no-defun-allowed: Works for me.
<no-defun-allowed> That's very strange.
<no-defun-allowed> I might try again then.
<no-defun-allowed> beach: I forgot my in-package declaration. My bad.
ltriant has joined #lisp
<beach> That would explain it.
<beach> There really should be a warning when DEFMETHOD mentions the name of a generic function that has not been explicitly defined.
<aeth> There used to be one in SBCL but people complained iirc
<aeth> I miss it.
<beach> People complain about lots of things.
torbo has quit [Remote host closed the connection]
ltriant has quit [Ping timeout: 245 seconds]
<no-defun-allowed> I don't think trying to prevent my idiocy is a high priority for compiler writers.
<no-defun-allowed> But that does sound useful, like the warnings for unknown variables in function bodies.
meepdeew has joined #lisp
miatomi has quit [Ping timeout: 250 seconds]
miatomi has joined #lisp
abhixec has quit [Ping timeout: 244 seconds]
meepdeew has quit [Remote host closed the connection]
notzmv has quit [Remote host closed the connection]
abhixec has joined #lisp
Arcaelyx has quit [Ping timeout: 245 seconds]
miatomi has quit [Ping timeout: 255 seconds]
varjag has quit [Read error: Connection reset by peer]
miatomi has joined #lisp
refpga has quit [Ping timeout: 250 seconds]
refpga has joined #lisp
<beach> Yeah. And it's a good idea for other reasons as well to supply an explicit DEFGENERIC.
<beach> You can attach documentation to it and you can give the parameters significant names, rather than OBJECT.
<beach> So the absence of a DEFGENERIC at least deserves a style warning.
rumbler31 has quit [Remote host closed the connection]
p0a has joined #lisp
smasta has joined #lisp
<p0a> Hello
<p0a> How can I create a vector that copies #(1 2 3) and has space for one more element?
smasta has quit [Ping timeout: 244 seconds]
smasta has joined #lisp
<oni-on-ion> an empty space, like a nil ?
miatomi has quit [Ping timeout: 246 seconds]
<p0a> I think it looks like I first have to create the array
<p0a> and then copy #(1 2 3) partially into it
<p0a> it doesnt' seem that MAKE-ARRAY
<p0a> has the capability of partially initializing a longer vector
<p0a> another question: What's the right way to setf to an index that I have fixed?
karlosz has quit [Quit: karlosz]
<oni-on-ion> clhs vector-push-extend
<p0a> I know I can do (setf (aref array i) x), but how can I save a /pointer/ to that so that I don't have to evaluate (aref array i) every time?
miatomi has joined #lisp
<oni-on-ion> (let ((x (aref array i))) ..) ?
abhixec has quit [Ping timeout: 245 seconds]
<p0a> ok that actually does it? I would've thought it just sets x to be the value
<oni-on-ion> if 'pointer' being a symbol that references some data
<oni-on-ion> if you have a REPL going on, you can check it out and see =)
<p0a> I am realzing now that I should be using setq nstead probably
smasta has quit [Ping timeout: 250 seconds]
<p0a> in fact svref is one thing I can do
Lord_of_Life has quit [Ping timeout: 244 seconds]
<p0a> oni-on-ion: thank you
<p0a> I think I know what to do now
p0a has quit [Quit: bye]
Lord_of_Life has joined #lisp
<oni-on-ion> ok =)
miatomi has quit [Ping timeout: 255 seconds]
shka_ has joined #lisp
longshi has joined #lisp
nirved_ has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
nirved has quit [Ping timeout: 258 seconds]
smasta has joined #lisp
<pjb> minion: memo for p0a: https://pastebin.com/uDqfg7fR
<minion> Remembered. I'll tell p0a when he/she/it next speaks.
miatomi has joined #lisp
Arcaelyx has joined #lisp
orivej has joined #lisp
smasta has quit [Ping timeout: 255 seconds]
lavaflow has quit [Read error: No route to host]
ltriant has joined #lisp
lavaflow has joined #lisp
clintm has quit [Remote host closed the connection]
ltriant has quit [Ping timeout: 245 seconds]
lavaflow_ has joined #lisp
lavaflow has quit [Ping timeout: 250 seconds]
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
oni-on-ion has quit [Quit: Leaving]
fivo has joined #lisp
izh_ has joined #lisp
catchme has joined #lisp
random-nick has joined #lisp
dale has quit [Quit: dale]
makomo has joined #lisp
smasta has joined #lisp
<makomo> morning
smasta has quit [Ping timeout: 246 seconds]
<catchme> Good morning
<catchme> How to force CFFI to reload shared-lib which have changed? I have tried cffi:reload-foreign-libraries, but it didn't load the new built lib
varjag has joined #lisp
refpga has quit [Ping timeout: 246 seconds]
refpga has joined #lisp
smasta has joined #lisp
<Inline> maybe the name of the lib chnaged also
<Inline> changed*
<Inline> check and provide the correct name
rumbler31 has joined #lisp
<catchme> I manually compile the lib. with the same name
<catchme> I use cffi:define-foreign-library, should I load the lib pathname ?
gjvc has quit [Ping timeout: 250 seconds]
smasta has quit [Ping timeout: 250 seconds]
rumbler31 has quit [Ping timeout: 246 seconds]
miatomi has quit [Ping timeout: 255 seconds]
miatomi has joined #lisp
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 246 seconds]
nowhere_man has joined #lisp
smasta has joined #lisp
refpga has quit [Remote host closed the connection]
smasta has quit [Ping timeout: 246 seconds]
ltriant has joined #lisp
ltriant has quit [Ping timeout: 244 seconds]
mc40 has joined #lisp
smasta has joined #lisp
shka_ has quit [Quit: Konversation terminated!]
smasta has quit [Ping timeout: 246 seconds]
mc40 has quit [Ping timeout: 258 seconds]
cyberoctopi has quit [Ping timeout: 244 seconds]
longshi has quit [Ping timeout: 244 seconds]
mc40 has joined #lisp
shka_ has joined #lisp
_whitelogger has joined #lisp
kajo has quit [Ping timeout: 258 seconds]
smasta has joined #lisp
cyberoctopi has joined #lisp
smasta has quit [Ping timeout: 244 seconds]
smasta has joined #lisp
cyberoctopi has quit [Ping timeout: 244 seconds]
Folkol has joined #lisp
smasta has quit [Ping timeout: 255 seconds]
miatomi has quit [Ping timeout: 246 seconds]
miatomi has joined #lisp
madmuppet006 has joined #lisp
miatomi has quit [Ping timeout: 250 seconds]
miatomi has joined #lisp
mc40 has quit [Ping timeout: 258 seconds]
cyberoctopi has joined #lisp
ricekrispie2 has joined #lisp
ricekrispie has quit [Ping timeout: 250 seconds]
cyberoctopi has quit [Ping timeout: 246 seconds]
ltriant has joined #lisp
madmuppet006 has quit [Read error: Connection reset by peer]
ltriant has quit [Ping timeout: 268 seconds]
smasta has joined #lisp
smasta has quit [Ping timeout: 268 seconds]
miatomi has quit [Ping timeout: 250 seconds]
miatomi has joined #lisp
xkapastel has joined #lisp
rumbler31 has joined #lisp
mc40 has joined #lisp
rumbler31 has quit [Ping timeout: 244 seconds]
vaporatorius has quit [Ping timeout: 246 seconds]
izh_ has quit [Quit: Leaving.]
shifty has joined #lisp
dddddd has joined #lisp
kotrcka has joined #lisp
smasta has joined #lisp
smasta has quit [Ping timeout: 255 seconds]
smasta has joined #lisp
miatomi has quit [Ping timeout: 246 seconds]
catchme has quit [Quit: Connection closed for inactivity]
smasta has quit [Ping timeout: 250 seconds]
miatomi has joined #lisp
wxie has quit [Ping timeout: 240 seconds]
kotrcka has left #lisp [#lisp]
anewuser has joined #lisp
random-nick has quit [Read error: Connection reset by peer]
ltriant has joined #lisp
smasta has joined #lisp
Kundry_Wag has joined #lisp
ltriant has quit [Ping timeout: 268 seconds]
smasta has quit [Ping timeout: 255 seconds]
fivo has quit [Quit: WeeChat 1.9.1]
nirved has joined #lisp
nirved_ has quit [Ping timeout: 258 seconds]
X-Scale has quit [Ping timeout: 246 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
mc40 has quit [Ping timeout: 259 seconds]
nanoz has joined #lisp
random-nick has joined #lisp
X-Scale has joined #lisp
t58 has joined #lisp
<drmeister> FLET functions can be declared inline - correct?
<drmeister> Is it reasonable to define macros that define flet functions that get inlined into the body of the macro?
<drmeister> (defmacro foo (&body body) `(flet ((foo-bar () ...)) (declare (inline foo-bar)) ,@body))
<drmeister> Yeah - I think that's what I'm looking for.
<pjb> Yes.
<drmeister> I'm potentially shadowing a function called foo-bar - but that's just what it is - right?
<pjb> Only if they're not in the CL package.
<pjb> You cannot use labels or flet with a symbol from the CL package.
<pjb> Otherwise, it's ok.
<drmeister> Ok - thank you.
<pjb> Notably, you can use flet to wrap around a global function.
<drmeister> Could you elaborate on that?
<pjb> (defun foo (x) (1+ x)) (flet ((foo (x) (print `(called (foo ,x))) (foo x))) (foo 42)) #| (called (foo 42)) --> 43 |#
<pjb> matter of scope.
gravicappa has quit [Ping timeout: 245 seconds]
gravicappa has joined #lisp
<pjb> In labels, the bodies are in the scope where the functions defined by the labels are visible (to allow for recursion). but with flet, it's the outer scope.
<drmeister> Ok - thank you.
<shka_> defun over flet over flet over flet :P
<drmeister> In Clasp we just got a new level of inlining in HIR. It's expensive and I'm thinking about general ways to improve the performance.
DGASAU has quit [Ping timeout: 255 seconds]
<shka_> right
<shka_> not sure about clasp, but in SBCL funcalling local functions is significantly cheaper than global function so inlining it is not very important
<drmeister> We should be able to do the same in Clasp with the fastcall calling convention.
nirved_ has joined #lisp
Arcaelyx has quit [Ping timeout: 250 seconds]
nirved has quit [Ping timeout: 258 seconds]
DGASAU has joined #lisp
smasta has joined #lisp
orivej has quit [Ping timeout: 268 seconds]
smasta has quit [Ping timeout: 268 seconds]
cosimone has joined #lisp
CuriousCain has joined #lisp
asarch has joined #lisp
Ukari has quit [Ping timeout: 246 seconds]
Kundry_Wag has quit [Remote host closed the connection]
SenasOzys has joined #lisp
smasta has joined #lisp
Ukari has joined #lisp
smasta has quit [Ping timeout: 246 seconds]
ltriant has joined #lisp
Aruseus has joined #lisp
<stylewarning> shka_: I didn't know that
ltriant has quit [Ping timeout: 245 seconds]
<shka_> stylewarning: described in the manual IIRC
<beach> shka_: There is still the issue of inlining in order to expose the context of the caller to the code of the callee.
<shka_> ok
<beach> However, there is an alternative to inlining called "specialization" that becomes practical in situations like that.
xkapastel has joined #lisp
<beach> Essentially, a special version of the callee is created, taking advantage of the context of the caller. But the special version is called, rather than being inlined.
<shka_> this does not strike me as a practical solution in the context of local functions though
<beach> Let me think...
<beach> I suppose if there are several call sites with the same context, so that the same specialized version could be used at all those sites, then the resulting code is smaller than if you inline.
<beach> So you get better cache performance and such.
<shka_> makes sense i guess
<beach> Otherwise, I don't see any particular advantage. I should read up on the literature again.
<shka_> though code would have to be on the big side of the scale for it to actually matter
<beach> Probably so.
FOSS_Fundraiser has joined #lisp
FOSS_Fundraiser has quit [Remote host closed the connection]
FOSS_Fundraiser has joined #lisp
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
smasta has joined #lisp
smasta has quit [Ping timeout: 268 seconds]
FOSS_Fundraiser has quit [Remote host closed the connection]
oni-on-ion has joined #lisp
stacksmith has joined #lisp
stacksmith has quit [Quit: stacksmith]
<dmiles> (package-use-list 'temp) => (#<PACKAGE COMMON-LISP>)
<dmiles> ;; in CLISP
<dmiles> is that correct behavour?
<phoe> why not
<phoe> what is surprising to you?
<dmiles> not totally surprised.. just trying to pick a default behavour for use-package
<dmiles> oops
<dmiles> for make-package
<phoe> default?
<dmiles> one that my implementation will use that wont confuse people
<dmiles> perhaps like SBCL's instead of CLISPs
<dmiles> SBCL returns NIL there
<phoe> dmiles: do you explicitly specify used packages?
<phoe> if not, it's implementation-dependent what goes there by default
<dmiles> ok so if the user should specified (make-package 'TEMP () () ) then they'd expect NIL ?
<dmiles> otherwise its impl dependant .. ok
<phoe> dmiles: that's an invalid call
smasta has joined #lisp
<phoe> :use '()
<dmiles> oh yes sorry :)
<dmiles> ok the next question .. i noticed in their example the the used-by-list contains itself.. that is fine as well?
<dmiles> in thge case of :use '()
<dmiles> (not that their example did so.. but in general i wouldnt want ot do that for :use '() right?)
<dmiles> not that their example did so.. since their exmaple merely showed some systems defaults
smasta has quit [Ping timeout: 268 seconds]
<dmiles> guess what i am asking if its fine for a (package-used-by-list ..) to be default return the package
<dmiles> (as well)
<pjb> dmiles: the only "good" alternatives for default use lists for make-package, are () and ("CL").
<pjb> the other defaults will involve implementation specific package, so they'll be worse. In anycase, conforming code needs to ignore this default and give it's own explicit package list.
<dmiles> () and ("CL") or do you mean () (*PACKAGE*) ?
<pjb> I mean for :use; the default for :nicknames is specified to be ().
<pjb> dmiles: there's no point of using *package* in the default use list, because in general, *package* doesn't export any symbol.
<pjb> and again, anyways it will be ignored by conforming programs. So you can as well just use ().
<dmiles> ahah, i was going to be slightly annoying, and :use (*PACKAGE*) as a default but i think i'll jsut go with ()
kajo has joined #lisp
SenasOzys has quit [Read error: Connection reset by peer]
Kundry_Wag has joined #lisp
ebrasca has joined #lisp
fanta1 has joined #lisp
wigust has quit [Read error: Connection reset by peer]
wigust has joined #lisp
abhixec has joined #lisp
ravndal has joined #lisp
rumbler31 has joined #lisp
smasta has joined #lisp
shifty has quit [Ping timeout: 268 seconds]
nowhere_man has quit [Ping timeout: 258 seconds]
ltriant has joined #lisp
smasta has quit [Ping timeout: 244 seconds]
ltriant has quit [Ping timeout: 250 seconds]
FOSS_Fundraiser has joined #lisp
FOSS_Fundraiser has quit [Remote host closed the connection]
wooden__ has quit [Ping timeout: 255 seconds]
wooden__ has joined #lisp
q9929t has joined #lisp
vms14 has joined #lisp
gravicappa has quit [Ping timeout: 255 seconds]
refpga has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
smasta has joined #lisp
q9929t has quit [Quit: q9929t]
vlatkoB has quit [Remote host closed the connection]
smasta has quit [Ping timeout: 246 seconds]
fanta1 has quit [Quit: fanta1]
Kundry_Wag has joined #lisp
nowhere_man has joined #lisp
Kundry_Wag has quit [Ping timeout: 244 seconds]
torbo has joined #lisp
angavrilov has quit [Quit: Konversation terminated!]
angavrilov has joined #lisp
hvxgr has quit [Quit: leaving]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Read error: Connection reset by peer]
Kundry_Wag has joined #lisp
smasta has joined #lisp
ggole has quit [Quit: Leaving]
smasta has quit [Ping timeout: 245 seconds]
sdumi has joined #lisp
cosimone has quit [Quit: WeeChat 2.3]
Lord_of_Life has quit [Ping timeout: 268 seconds]
orivej has joined #lisp
FOSS_Fundraiser has joined #lisp
Lord_of_Life has joined #lisp
torbo has quit [Remote host closed the connection]
gareppa has joined #lisp
bitch has quit [Disconnected by services]
gareppa has quit [Max SendQ exceeded]
nanoz has quit [Ping timeout: 268 seconds]
gareppa has joined #lisp
asarch has quit [Quit: Leaving]
Arcaelyx has joined #lisp
FOSS_Fundraiser has quit [Remote host closed the connection]
FOSS_Fundraiser has joined #lisp
Dildeaux has joined #lisp
FOSS_Fundraiser has quit [Killed (tomaw (<No reason given>))]
Dildeaux has quit [K-Lined]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
shka_ has quit [Ping timeout: 250 seconds]
ltriant has joined #lisp
cyraxjoe has quit [Quit: No Ping reply in 180 seconds.]
cyberoctopi has joined #lisp
cyraxjoe has joined #lisp
ltriant has quit [Ping timeout: 246 seconds]
gareppa has quit [Quit: Leaving]
angavrilov has quit [Remote host closed the connection]
Kundry_Wag has quit [Remote host closed the connection]
moldybits has quit [Quit: WeeChat 2.4]
xkapastel has quit [Quit: Connection closed for inactivity]
smasta has joined #lisp
moldybits has joined #lisp
defaultxr has joined #lisp
smasta has quit [Ping timeout: 245 seconds]
smasta has joined #lisp
hiroaki has quit [Ping timeout: 246 seconds]
CrazyEddy has quit [Ping timeout: 245 seconds]
smasta has quit [Ping timeout: 245 seconds]
marusich has joined #lisp
anewuser has quit [Quit: anewuser]
jfe has joined #lisp
<jfe> hello
<jfe> is there a tool like python's pipenv for CL?
marusich has quit [Remote host closed the connection]
anewuser has joined #lisp
Kundry_Wag has joined #lisp
dale has joined #lisp
ltriant has joined #lisp
smasta has joined #lisp
<pjb> jfe: what makes you think we know anything about python in general, and pipenv in particular? You could as well ask if there's a tool like 迷人的剪輯 of 開花的鍬 for CL.
<pjb> jfe: you should learn how to speak English, instead of Tamarian.
smasta has quit [Ping timeout: 268 seconds]
random-nick has quit [Read error: Connection reset by peer]
<Inline> evening
<Inline> pjb: i have a question
<Inline> pjb: instead of the `(,(read-from-string (nth.... forms explicitly, how can i traverse a nested form with loop ?
dddddd has quit [Ping timeout: 255 seconds]
hvxgr has joined #lisp
makomo has quit [Quit: WeeChat 2.2]
dddddd has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
varjag has quit [Ping timeout: 244 seconds]
longshi has joined #lisp
oni-on-ion has quit [Ping timeout: 244 seconds]
longshi has quit [Ping timeout: 250 seconds]
gjvc has joined #lisp
<Inline> pjb: nvm, found already
<Inline> meh
ltriant has quit [Ping timeout: 255 seconds]
lumm has joined #lisp
nowhere_man has quit [Ping timeout: 255 seconds]
gjvc has quit [Remote host closed the connection]
<pjb> …
smasta has joined #lisp
<pjb> Inline: well, already, nested -> recursive, not iterative…
<pjb> Inline: otherwise, you can use a loop with a stack.
wxie has joined #lisp
<pjb> Inline: then, don't use strings, use sexps! (setf ans (append ans (list `(,eqstr = ,(eval eqstr)))))
<pjb> Once you avoid strings, you don't need iter.
smasta has quit [Ping timeout: 246 seconds]
shifty has joined #lisp
vms14 has quit [Quit: WeeChat 2.3]
smasta has joined #lisp
<aeth> jfe: There's a lot to unpack in that question. "pipenv" combines "pip" with "virtualenv". Well, we have a pip equivalent in Quicklisp. Do we have a virtualenv? Well, the virtualenv documentation says that the primary problem it solves is when one library wants to stay on version 1 of a library and another requires version 2 of a library. That's not a problem that the Common Lisp ecosystem typically faces.
<pjb> Inline: you can avoid eval, using a macro: http://dpaste.com/0R2VH27
Kundry_Wag has joined #lisp
<pjb> Inline: I didn't avoid the when eval, assuming you wanted to filter the expressions at compilation-time.
<pjb> jfe: indeed, currently quicklisp doesn't deal with multiple version, it selects a current version for all the libraries. It must be consistent: all dependents should use the same version distributed in quicklisp.
<pjb> jfe: so basically, the correct answer to your question was: 亩
smasta has quit [Ping timeout: 246 seconds]
<pjb> jfe: ironically, I was close to it, right? :-)
<aeth> jfe: Common Lisp doesn't really like having multiple incompatible versions of the same library at once because usually lots of things are loaded in one image, and if you were to have foo version1 and foo version2 both loaded in the same image, that would cause issues. For instance, tThey probably would want at least one conflicting package with the same name: foo.
<aeth> s/tThey/they/
karlosz has joined #lisp
<aeth> It's possible to encode the version number in the package name and use package local nicknames, but that's very uncommon (if anyone has ever done that at all).
lumm has quit [Quit: lumm]
<aeth> It's possible you might want two separate Common Lisp images running at the same time, with two different sets of libraries available to it. You can do that, but I don't think there's a tool for that. It wouldn't be that hard, though, afaik. You would just need to change what ASDF (or Quicklisp) looks for, and have two different directories. That would probably be close to pipenv.
lumm has joined #lisp
<aeth> That might make sense for production, but it wouldn't really make sense for development, since in development, you'd probably want them all in the same image, just for convenience. So the actual conflicts making this sort of thing necessary would be far less likely to develop because of how CL is programmed.
<aeth> i.e. Beacuse you normally load source or fasls into an image for interactive development instead of running separate, independent CL instances during development, actual conflicts developing will be very rare because it conflicts with how CL is normally written.
<aeth> I guess it's inevitable that one day the community scale means that you might need to have multiple "virtualenv"-like CLs that you have to connect to with SLIME, but people have avoided that so far because it would make things more painful. Right now, the CL ecosystem can get away with shortcuts.
<aeth> The tl;dr of it probably is it's not there because (1) it would be less convenient in CL, (2) the CL community is small and the libraries rarely break compatibility, and (3) the way CL is written, i.e. #1, means that that sort of workflow will be resisted as long as possible even though it might eventually be necessary
igemnace has joined #lisp
<Inline> pjb: welp, ok, but i really mind the lots of keywords in loop constructs....
<Inline> lol
lavaflow_ has quit [Ping timeout: 246 seconds]
anewuser has quit [Ping timeout: 255 seconds]
lavaflow_ has joined #lisp
zooey has joined #lisp
aindilis has quit [Remote host closed the connection]
pierpal has joined #lisp
aindilis has joined #lisp
bitch has joined #lisp
wxie has quit [Ping timeout: 250 seconds]
smasta has joined #lisp
madmuppet006 has joined #lisp
pierpal has quit [Ping timeout: 268 seconds]
<madmuppet006> what control string would I use to give a space in a format .. I did try (format str #\space) but it doesnt work .. I have been looking online and the closest thing I can find is padchar but I do not think its what Im looking for and there are no examples of its use .. thanks in advance
<grewal> You can use a literal space in your control string, e.g. (format nil "~a ~a" arg1 arg2)
<madmuppet006> thanks will try that ..
smasta has quit [Ping timeout: 246 seconds]
smasta has joined #lisp
dieggsy has quit [Quit: ZNC 1.7.3 - https://znc.in]