jackdaniel 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/> | offtopic --> #lispcafe
kaftejiman_ has quit [Ping timeout: 246 seconds]
ramHero has quit [Ping timeout: 260 seconds]
rgrmrts has joined #lisp
X-Scale` has joined #lisp
nicktick has joined #lisp
bilegeek has quit [Quit: Leaving]
X-Scale has quit [Ping timeout: 256 seconds]
X-Scale` is now known as X-Scale
edgar-rft has quit [Quit: Leaving]
rgrmrts has quit [Quit: beep boop]
galex-713 has quit [Quit: No Ping reply in 180 seconds.]
galex-713 has joined #lisp
d4ryus1 has joined #lisp
d4ryus has quit [Ping timeout: 240 seconds]
yonkunas has quit [Quit: Connection closed for inactivity]
kaftejiman_ has joined #lisp
kaftejiman__ has quit [Ping timeout: 265 seconds]
<remexre> does quicklisp allow depending on versions? e.g. I need the foo system, with a version >= 1.3 && < 2.0
<asarch> What is a LOAD-SYSTEM-DEFINITION-ERROR?
<asarch> Nevermind, I get to the error where there is no *CC*
<asarch> Condition of type: LOAD-SYSTEM-DEFINITION-ERROR
<asarch> Error while trying to load definition for system static-vectors from pathname /data/data/org.eql5.android.repl/files/quicklisp/dists/quicklisp/software/static-vectors-v1.8.6/static-vectors.asd: Cannot find the external symbol *CC* in #<"C" package>
toorevitimirp has joined #lisp
ganjajim has quit [Remote host closed the connection]
<defunkydrummer> remexre: no, quicklisp comes in "distributions" and the libraries in one distribution are all compatible against each other (hopefully)
<defunkydrummer> remexre: I think that what you want can be done with certain utilities that go on top of quicklisp, but i don't have more details to offer.
akoana has left #lisp ["Leaving"]
<aeth> defunkydrummer: actually, with utilities that go under quicklisp, i.e. ASDF
<aeth> asdf has version-satisfies and version< and version<=
<remexre> hm, okay; this is a hypothetical anyway, any important projects I'
<remexre> m already vendoring w/ submodules
<aeth> ASDF's version functionality will only handle dot-separated natural numbers
<aeth> Oh, version-satisfies is ASDF and the lower-level version< and version<= are uiop
<aeth> remexre: (and (uiop:version<= "1.3" version) (uiop:version< version "2.0"))
<aeth> You would probably have to patch Quicklisp to support x (<= or <) version (<= or <) y
<aeth> But the underlying UIOP+ASDF system that Quicklisp uses does seem to support this functionality.
kaftejiman_ has quit [Remote host closed the connection]
asarch_ has joined #lisp
asarch_ has quit [Client Quit]
asarch has quit [Ping timeout: 272 seconds]
Xach has quit [Ping timeout: 246 seconds]
Xach has joined #lisp
zulu-inuoe_ has quit [Read error: Connection reset by peer]
Inline has quit [Ping timeout: 272 seconds]
defunkydrummer has quit [Ping timeout: 258 seconds]
defunkydrummer has joined #lisp
dbotton86 has joined #lisp
dbotton86 is now known as dbotton__
<dbotton__> Do most major projects in commercial use today of CL use CLOS?
<no-defun-allowed> I don't know about "in commercial use", but most projects I've seen use CLOS.
Kaisyu7 has quit [Quit: ERC (IRC client for Emacs 26.3)]
<dbotton__> It just seems like much of what I am seeing on the web is an emphasis on the functional paradigm with lisp
<dbotton__> bordering on discouraging oo or procedural
<no-defun-allowed> CLOS can be used in a functional manner; there was a paper about it, but there are no a priori reasons either excludes the other to me.
<dbotton__> you have a link?
<no-defun-allowed> Looking for one now.
<dbotton__> thanks
<dbotton__> are there efforts for an update to the standard (if that is even needed)?
<no-defun-allowed> But I suppose there are a lot of resources (of questionable quality) stating that Lisp is only a function language.
<dbotton__> in the algol world if a lang doesn't get a boost every 10 years is considered dead...
<dbotton__> it is the imperative and oo so far that have me interested
<no-defun-allowed> Not to my knowledge; all the common extensions (eg closer-mop, bordeaux-threads) are agreed upon outside the standard.
<dbotton__> if I see that functional gets me some place all the better
<dbotton__> I have felt that most functional programing I have encouraged just took away readability and quality
<remexre> arguably, cl has strong enough metaprogramming that spec updates aren't needed for stuff that other languages put in spec updates
<dbotton__> that is how things seem to me, but I am far from fully grasping the full picture yet
<remexre> also as someone who writes the programs you're complaining about, I think that Haskell/PureScript do that style of FP better :P
<remexre> but you /can/ e.g. use the Cont monad in CL
<remexre> it's just not, like, normal
<no-defun-allowed> Do what you have to do; but I've observed that functional programming involves less hair-pulling with parallel programs.
<dbotton__> Convenience is what I have seen it offer
<dbotton__> for parallel programing
<remexre> for concurrent programming, I think it has compelling advantages
<remexre> since you can implement green threads easily as a library, force shared mutable state to use stm, etc
<no-defun-allowed> I don't really have anything to say about concurrent programming, other than shared state is evil.
<remexre> STM lets you phrase your uses of shared state as transactions, and you can compose transactions
<dbotton__> Everything I have done since around 1993 till now has been concurrent systems, I can't imagine an app anymore without
<dbotton__> the Ada model has worked well
<remexre> like shared state is still to be avoided with it, but it removes most of the mutex footguns
<dbotton__> and extended well for distributed systems.
<dbotton__> I have not done much though with parallel algorithms
<dbotton__> ie drilling down not out
<dbotton__> are there any concurrency models using CLOS that are popular?
<dbotton__> something like Active Oberon?
<no-defun-allowed> As far as I can tell, it'd be nonsensical, as objects don't "do things" like in object-centric languages including Oberon.
<dbotton__> the idea is to encapsulate the shared state issues
<remexre> I think I'd use local variables for that :P
<dbotton__> and if you object being shared in two threads?
<remexre> don't do that (TM)
<remexre> most of my data is immutable
<dbotton__> yes that is the convenience of functional
<dbotton__> at the loss of modeling the real world etc the advantages of oo etc
<aeth> dbotton__: On CLOS... if your style isn't particularly OO, it's still going to be used here or there to get polymorphism.
<aeth> It would be maybe like 5% of the depth that CLOS offers, of course.
<remexre> yeah, I use CLOS more to be able to use methods/generic functions than b/c objects model my domain well
<aeth> dbotton__: CLOS is actually really good at being used in a project that isn't particularly object oriented because instead of putting methods with an object, you can just refactor your function into a method if suddenly you need/want polymorphism, without having to do any major changes.
<aeth> really just s/defun/defmethod/
<aeth> In most OOP languages, you'd have to move the method inside of the class definition, and maybe move it to another (possibly new) file if that class is defined there
<aeth> And then you'd probably have to change foo(bar, baz) into bar.foo(baz) too
<dbotton__> That was what I like but Ada's OO also more granular and can use it in parts
<aeth> (or baz.foo(bar))
<dbotton__> thanks going to read that article
dbotton__ has quit [Remote host closed the connection]
<aeth> dbotton__: if "can use it in parts" means that you can subset the OO in Ada but can't in CL, then, yeah, CLOS is sort of all-or-nothing from an implementation perspective (and every application is also going to have to ship it)
<aeth> DEFSTRUCT kind of exists as a sort of subset, though.
<dbotton> use it in parts means more control over where polymorphism applies
<dbotton> or other oo magic
<dbotton> seems that clos is similar
<sm2n> well, if you don't want it, just use regular functions
<sm2n> generic functions are regular functions with fancy pixie dust
<dbotton> but can hold on to encapsulated
Stanley00 has joined #lisp
<dbotton> encapsulation
jesse1010 has quit [Ping timeout: 246 seconds]
<aeth> yeah, you can just use a DEFUN even if the argument is of a certain class
<aeth> I would argue that you should use a DEFUN instead of a DEFMETHOD unless you want (1) to use polymorphism, (2) to use :before/:after/:around, and/or (3) to let the user of the API do #1 or #2
<aeth> Except, of course, for the accessors that are usually auto-generated anyway. That's more practicality than anything else. It would be very easy to have a name conflict for something like NAME.
<defunkydrummer> aeth: #3 to gain some type safety (will only dispatch if the parameters are of the correct specializers)
<defunkydrummer> aeth: sorry, reason #4 would be to gain some type safety...
<defunkydrummer> and to leave your system open for further extension
<aeth> defunkydrummer: No, you can just use DECLARE or CHECK-TYPE (but use a macro that generates one or both of those) when you just want to work with a type (including classes).
<defunkydrummer> aeth: yes you can but the effect will depend on the implementation
<aeth> CHECK-TYPE is well-specified. DECLARE will depend on the implementation, but will reasonably either just be ignored or do type checking. The only implementation that assumes types is SBCL with (safety 0) and the general advice is to never use (safety 0) for that reason.
<defunkydrummer> i love (safety 0) (debug 0) (speed 3) ... YOLO mode
<aeth> But if semantically you want to check the type then semantically you should do typechecking, not DEFMETHOD, unless you want the user (or yourself) to add more supported types in a polymorphic way later on.
<aeth> For one, it'll give you a good error message
<beach> Good morning everyone!
<defunkydrummer> bonjour Beach
<defunkydrummer> aeth: yes, that's my point, declare will depend on the implementation, while any implementation that has CLOS won't dispatch to the method if the arguments aren't of the correct type (or subtype etc)
<aeth> Personally I'd use my own define-function macro for your particular case (if I wanted to guarantee type checking) and write it as (define-function (foo :check-type t) lambda-list body)...
<aeth> ...and if the types are also classes and if I don't define types for &key or &body or &optional (which I support but defmethod does not) then it could easily be refactored into (defmethod foo lambda-list body) at some later point if I find that I need polymorphism.
<aeth> There are lots of macros like this, but they're imo broken if (1) they use the opposite order of defmethod (i.e. if they use (type var) instead of (var type)) or (2) they don't allow you to use check-type instead of declare
<aeth> I'm personally more likely to need &key types checked than I am going to need polymorphism, although I guess I could come up with a define-method that creates a wrapper function that flattens the &key/&optional and calls a defmethod
<defunkydrummer> aeth: agree with you on the "broken" part
<aeth> defunkydrummer: Generally, I use DECLARE on "internal" things and CHECK-TYPE on "external" things, but I write... very large software, so I wind up using DECLARE more than CHECK-TYPE... and absolutely all of it is generated by DEFINE-FUNCTION these days.
<aeth> That is, for internal things, it's not going to be the end of the world if the type's not checked, and probably even if the type's assumed, but for external things, the CHECK-TYPE's continuable nature makes it more suitable than even a DEFMETHOD.
orivej has quit [Ping timeout: 256 seconds]
<aeth> defunkydrummer: I actually wonder if there's a way to enforce a CHECK-TYPE style behavior if there's no applicable method. e.g. in (defmethod foo ((integer integer)) (* integer integer)) vs. (defun foobar (integer) (check-type integer integer) (* integer integer)) you can provide an integer in the latter
sts-q has quit [Ping timeout: 256 seconds]
<defunkydrummer> aeth: i think there was a way (using mop i think?) to redirect the 'no applicable method' to another place. Like if we were on a message-passing system (smalltalk). I think no-defun-allowed knows about this.
<defunkydrummer> no-defun-allowed: oi
<no-defun-allowed> clhs no-applicable-method
<no-defun-allowed> Smalltalk has doesNotUnderstand: aMessage which would be called with messages it doesn't have any other methods for. Note that this is per generic function though, and I admittedly can't think of something this could do that a method specialised to all Ts couldn't do.
<aeth> oh, hmm, I guess the issue with trying to do something in the style of CHECK-TYPE is that you'd need a matching type signature of every argument at once.
<aeth> You couldn't just iterate over each and ask for something to be valid, since what you really want is a valid combination.
space_otter has joined #lisp
sts-q has joined #lisp
Volt_ has joined #lisp
gravicappa has joined #lisp
contrapunctus has left #lisp [#lisp]
contrapunctus has joined #lisp
notzmv has quit [Ping timeout: 260 seconds]
notzmv has joined #lisp
saganman has joined #lisp
Jeanne-Kamikaze has joined #lisp
<sm2n> is there anyway to get cl-who/hunchentoot to indent html output?
<no-defun-allowed> (with-html-output (... :indent t) ...)
<sm2n> woah, thanks I missed that in the docs
kiroul has quit [Ping timeout: 246 seconds]
contrapunctus has left #lisp ["Disconnected: closed"]
Bike has quit [Quit: Lost terminal]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
cjv has quit [Quit: Textual IRC Client: www.textualapp.com]
toorevitimirp has quit [Ping timeout: 260 seconds]
renzhi has quit [Ping timeout: 264 seconds]
skapata has quit [Remote host closed the connection]
jello_pudding has quit [Ping timeout: 240 seconds]
toorevitimirp has joined #lisp
skapata has joined #lisp
jello_pudding has joined #lisp
borei has joined #lisp
<borei> good morning/afternoon !
<borei> does anybody has experience with ceph object storage. Im working on CL rados client. Started to get first results, performance is not fantastic, most probably it's because of my ceph cluster layout, but anyway decided to ask if somebody worked on the same project.
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
torbo has quit [Remote host closed the connection]
bocaneri has joined #lisp
Cymew has joined #lisp
narimiran has joined #lisp
gravicappa has quit [Ping timeout: 246 seconds]
IPmonger has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
IPmonger has joined #lisp
defunkydrummer has quit [Ping timeout: 240 seconds]
Jeanne-Kamikaze has quit [Ping timeout: 246 seconds]
borei has quit [Ping timeout: 260 seconds]
alxplorer has joined #lisp
emys has joined #lisp
ibinderwolf has quit [Remote host closed the connection]
sword865 has joined #lisp
alxplorer has quit [Remote host closed the connection]
alxplorer has joined #lisp
alxplore_ has joined #lisp
alxplorer has quit [Ping timeout: 244 seconds]
emys has quit [Ping timeout: 260 seconds]
shka_ has joined #lisp
emys has joined #lisp
random-nick has joined #lisp
CrazyEddy has quit [Ping timeout: 272 seconds]
alxplore_ has quit [Remote host closed the connection]
alxplorer has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
orivej has joined #lisp
emys has quit [Ping timeout: 256 seconds]
arbv has quit [Ping timeout: 264 seconds]
alxplorer has quit [Ping timeout: 260 seconds]
d4ryus1 is now known as d4ryus
gaqwas has joined #lisp
emys has joined #lisp
toorevitimirp has joined #lisp
emys has quit [Ping timeout: 264 seconds]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
emys has joined #lisp
pve has joined #lisp
liberliver has joined #lisp
emys has quit [Ping timeout: 272 seconds]
skapata has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 260 seconds]
emys has joined #lisp
Volt_ has quit [Quit: ]
jprajzne1 has joined #lisp
scymtym has quit [Ping timeout: 256 seconds]
emys has quit [Ping timeout: 264 seconds]
space_otter has quit [Remote host closed the connection]
emys has joined #lisp
rgherdt has joined #lisp
Kaisyu7 has joined #lisp
frost-lab has joined #lisp
arbv has joined #lisp
toorevitimirp has quit [Quit: Konversation terminated!]
galex-713 has quit [Ping timeout: 246 seconds]
gaqwas has quit [Remote host closed the connection]
emys has quit [Ping timeout: 240 seconds]
decentyousername has joined #lisp
hendursa1 has joined #lisp
Nilby has joined #lisp
scymtym has joined #lisp
hendursaga has quit [Ping timeout: 240 seconds]
alxplorer has joined #lisp
emys has joined #lisp
davepdotorg has joined #lisp
emys has quit [Ping timeout: 244 seconds]
galex-713 has joined #lisp
emys has joined #lisp
<ioa> can anyone make a good case about two-phase unwinding in common-lisp, especially wrt to `finally` in Java? https://github.com/WebAssembly/exception-handling/issues/87#issuecomment-707482499
<ioa> we are trying to make initial support for WebAssembly exceptions compatible with a future two-phase unwinding extension
emys has quit [Ping timeout: 240 seconds]
<no-defun-allowed> To my knowledge, finally is implemented in Java like a catch that catches every exception, does its business, then rethrows. It doesn't appear to have much in common with Common Lisp, because signalling a condition is one of many things that causes non-local transfer of control.
frgo_ has joined #lisp
treflip has joined #lisp
luis75 has quit [Quit: The Lounge - https://thelounge.chat]
<no-defun-allowed> And the condition system is (usually) just implemented with dynamic variables and some other control structure.
frgo has quit [Ping timeout: 265 seconds]
<pve> I can't help, but I would like to learn what "two-phase unwinding" means.
<phoe> I can help\
emys has joined #lisp
<beach> clhs 5.2
<specbot> Transfer of Control to an Exit Point: http://www.lispworks.com/reference/HyperSpec/Body/05_b.htm
<beach> I am guessing that's what ioa is referring to.
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
* pve reads
contrapunctus has left #lisp ["Disconnected: closed"]
alxplorer has quit [Remote host closed the connection]
alxplorer has joined #lisp
contrapunctus has joined #lisp
emys has quit [Ping timeout: 272 seconds]
<pve> How would a simpler unwinding look? Does "one-phase unwinding" exist?
<phoe> yes
<ioa> For aheejin in the Wasm question I posted, exceptions with two-phase unwinding are exceptions that first locate the point where they are caught before starting the unwinding/filtering etc process of being thrown.
<phoe> it's unwind-protect
<phoe> ioa: I'm preparing a post there
emys has joined #lisp
<ioa> That's great news phoe! Looking forward to your answer.
<ioa> But I'm confused about unwind-protect being "one-phase unwinding"
<phoe> when control leaves the unwind-protect form, no matter how it leaves, the cleanup form is executed, then whatever was happening resumes
<phoe> that's it
jonatack has quit [Ping timeout: 264 seconds]
<ioa> thank you beach, that is a good link describing the unwinding phases in common-lisp
<beach> Sure.
<ioa> phoe the text in clhs 5.2 describes unwind protect causing several things to happen between an exception being thrown and the stack being unwound to the exception's catching point.
<ioa> one-phase unwinding would be nothing happenning except the unwinding.
<ioa> *happening.
alxplorer has quit [Remote host closed the connection]
<beach> ioa: I think if you did it in one phase, you would not be able to "abandon" exit points between the signaler and the handler.
<phoe> oh! I misunderstood the "two-phase unwinding" term then
* phoe reads more
<beach> ioa: That makes a difference when an UNWIND-PROTECT does some non-local transfer to an exit point that is between the initial signaler and its handler.
<beach> In Common Lisp that's undefined behavior.
<ioa> I'm not sure what you mean beach. Please note that WebAssembly is designed really differently than common-lisp. There are no such things like exit points in Wasm.
<phoe> beach: I think that's on a different level though
<beach> Oh, I am not speaking about WebAssembly at all. Just describing how Common Lisp does it.
<phoe> oh - OK
karlosz has quit [Quit: karlosz]
emys has quit [Ping timeout: 265 seconds]
karlosz has joined #lisp
<phoe> point 1 of 5.2 basically means that cleanup forms can no longer transfer control to exit points that are now in the "middle" - that's UB though, so the burden is on the programmer anyway
<ioa> Ah, sorry beach, of course. So you are saying that stack unwinding when common-lisp conditions are signalled have definitely more than one phase.
frgo_ has quit [Remote host closed the connection]
<phoe> ioa: yes, but this can be implemented in CL
<phoe> we do not need to have wasm support for this.
karlosz has quit [Remote host closed the connection]
<ioa> not sure what you mean phoe
<phoe> as long as we have dynamic variables, we can undo catch tags, condition handlers, and restarts ourselves
<phoe> this resolves point 3 of CLHS 5.2
<phoe> if I understand correctly, then we do not strictly need to implement point 1 of CLHS 5.2 because it's UB anyway and the burden is on the programmer
<ioa> what's UB? :)
<phoe> undefined behavior
<ioa> thanks
<phoe> this leaves point 2 ("The cleanup clauses of any intervening unwind-protect clauses are evaluated.") and point 4 which performs the real jump
emys has joined #lisp
<beach> ioa: As phoe points out, all that is needed is special variables and some non-local transfer mechanism. One hopes that the language has non-local transfers, or it would be pretty much useless for anything but toy programs.
<phoe> beach: yes, that is what they are discussing over there
aeth has quit [Ping timeout: 265 seconds]
<ioa> Yes, we are also discussing potential non-local control transfer mechanisms, although please note the "Assembly" in "WebAssembly". The language is not intended to be written directly, but as a compilation target.
<beach> ioa: Sure, but then you need some control over the dynamic environment.
aeth has joined #lisp
<beach> ioa: I guess having access to the call stack would be enough.
<ioa> Wasm has a unified call/value stack
alxplorer has joined #lisp
<ioa> so a frame is an administrative instruction, as is its end, as is a constant, etc
<ioa> and these all go on the same stack
nicktick has quit [Ping timeout: 272 seconds]
<beach> I think the minimal mechanism required would be something like setjmp/longjmp where you abandon some currently executing functions.
<phoe> Please review
<no-defun-allowed> Is there a missing function name around (let (((lambda () (return-from frobnicate 42)))) ...)?
<phoe> oh snap
<phoe> yes, thanks
<phoe> fixed
emys has quit [Ping timeout: 246 seconds]
<ioa> phoe I wasn't aware of this, thanks "the stack is wound further instead of being unwound"
<phoe> ioa: doh
<ioa> ?
<phoe> I was talking about this on the first Online Lisp Meeting :D
<ioa> Oh I must have missed that insight, sorry.
<phoe> no problem, just kidding
<ioa> :)
<phoe> but, yes, Lisp does error-handling differently
<beach> ioa: That's the key to doing restarts.
<phoe> beach: and to the functioning of the Lisp debugger
<beach> Indeed.
<beach> Most current languages are deficient in this respect. It wouldn't surprise me if something like WebAssembly assumed this deficiency, since it is so widespread.
<ioa> beach - that's why I asked here :)
<phoe> okay, I've rearranged the things in that post a little bit - it should be cleaner now
<ioa> "I'll be supporting this issue as a Common Lisp programmer." what do you mean by this phoe?
<phoe> I should have written "if you need any CL insight I'll be available to answer"
<ioa> brilliant, thanks
<ioa> UB is not defined in your post ;)
<phoe> ioa: fixed
<no-defun-allowed> "Yes, UB is UB..."
<phoe> no-defun-allowed: does it look OK now?
* no-defun-allowed reads
<phoe> or, anyone else who's taken a look so far
<no-defun-allowed> Looks good.
<ioa> I'm worried it's too verbose tbh. aheejin is already aware of unwind-protect, she links to the clhs entry for unwind-protect
<phoe> is UNWIND-PROTECT equivalent to Java's finally?
<phoe> because it seems so
<phoe> yes, I've just seen it
<ioa> phoe I heard this before, and I guess that is the question at hand
<no-defun-allowed> Java only has exceptions for NLTC, but basically yes.
<phoe> hmm
<phoe> let me try to trim this down then
<no-defun-allowed> (So try { ... } finally { ...} is compiled like try { ... } catch (Exception e) { ...; throw e; } -- but in a parallel universe where Java had TAGBODY, it'd probably have to obey finally.)
jesse1010 has joined #lisp
<no-defun-allowed> (I'm probably being too pedantic after having read how exceptions are compiled.)
<ioa> you can call functions in webassembly and there is a `return`instruction (not a `return-from`, but there is a `br l` (break to label l)).
<phoe> no-defun-allowed: uh wait a second though
<phoe> you forgot the no-exception case
<no-defun-allowed> Indeed I did.
<ioa> I'm not sure what you are trying to say in the 4th part, this seems very well known
<ioa> sorry 3rd part
jonatack has joined #lisp
<phoe> ioa: I've trimmed the post a little bit
<no-defun-allowed> I can't think of how to express that in plain Java. But one can also return "early" in the try block, so I wonder how that pans out. 'Tis a silly place.
<ioa> in fact, in wasm we'd only be interested in a primitive that does this: "If (foo) does not return normally (meaning, a non-local jump outside the unwind-protect form is performed), then, before control leaves the unwind-protect form, (bar) is executed, and then the transfer of control proceeds further."
<phoe> OK - is the current version of the post more on-topic?
<ioa> yes phoe, looks good, thank you!
<phoe> no-defun-allowed: is this good to go now?
<no-defun-allowed> I think so.
perrier-jouet has joined #lisp
<phoe> OK, posting
Alloc has joined #lisp
<phoe> thanks for the cooperation, everyone
<jackdaniel> someone writes wasm cl?
<phoe> IIUC not yet, but the groundwork is being prepared right now
<jackdaniel> scl author was advocating for lisp-friendly features in wasm
<phoe> seems like ioa is doing the same :D
<jackdaniel> afair he has encountered some pushback, I don't know how much he advocated succesfully
<ioa> :)
<jackdaniel> one day operating system will degrade to a single "browser" window, tabs will become floating windows, hardware will implement directly wasm and we'll reach early '80 OS state of the art in glory
<jackdaniel> (in other words, we'll trade C-descendent unix for JS-descendent googlix)
<ioa> Of course I am advocating lisp-friendly features everywhere. :) But I keep in mind that Wasm is an Asm, so if CL can be implemented in Asm then it can be implemented in Wasm too. No need to be overly fanatic about it. I just like to write the spec in formulas and then implement it.
<ioa> jackdaniel hahahaha :D
<jackdaniel> ioa: I'm not criticizing wasm per se, it is a wonderful improvement over javascript, I keep fingers crossed
<ioa> :)
frost-lab has quit [Quit: Ping timeout (120 seconds)]
<ioa> I am quite fond of wasm - the spec is one of my favourite documents, so formal! <3
frost-lab has joined #lisp
emys has joined #lisp
supercoven has joined #lisp
<ioa> jackdaniel, any links to this scl author advocating lisp-friendly features in wasm?
<phoe> now that you mention it I wonder what happened to scl
<jackdaniel> let me see, maybe I have it bookmarked somewhere
<jackdaniel> this is the offspring of that advocacy: https://hacks.mozilla.org/2019/11/multi-value-all-the-wasm/
<ioa> this is my coworker's doing :)
<jackdaniel> great :)
<ioa> oh wait I said that before I clicked
jonatack has quit [Ping timeout: 264 seconds]
<ioa> I meant the SM implementation
jonatack has joined #lisp
<ioa> thanks jackdaniel!
<jackdaniel> sure
<ioa> here's the post about the SM implementation of multi-value in wasm just in case https://wingolog.org/archives/2020/04/03/multi-value-webassembly-in-firefox-from-1-to-n
<jackdaniel> I saw it
<jackdaniel> cool stuff :)
<ioa> :)
gravicappa has joined #lisp
<ioa> phoe about "unwind-protect - it is equivalent to Java's finally." is this formal equivalency? Any pointers to this?
emys has quit [Ping timeout: 260 seconds]
<phoe> http://clhs.lisp.se/Body/s_unwind.htm: "unwind-protect evaluates protected-form and guarantees that cleanup-forms are executed before unwind-protect exits, whether it terminates normally or is aborted by a control transfer of some kind."
<phoe> https://docs.oracle.com/javase/tutorial/essential/exceptions/finally.html: "The finally block always executes when the try block exits. This ensures that the finally block is executed even if an unexpected exception occurs. But finally is useful for more than just exception handling — it allows the programmer to avoid having cleanup code accidentally bypassed by a return, continue, or break."
<ioa> thanks
orivej has joined #lisp
gaqwas has joined #lisp
<ioa> fyi labels and breaks to labels are always nested in wasm. There is no going to arbitrary places.
<phoe> same in Lisp - you can't go somewhere that is not in the lexical or dynamic scope of whatever you're doing right now
<phoe> to be more precise: lexical for go/return-from, dynamic for throw and go/return-from closures
emys has joined #lisp
<jackdaniel> there is a cleanup issue about dynamic extent possible implementations (minimal, medium and something) which discusses closures that escape their dynamic context
<jackdaniel> i.e (block foo (lambda () (return-from foo)))
narimiran has quit [Ping timeout: 264 seconds]
<phoe> from what I understand, MINIMAL was adopted
gaqwas has quit [Remote host closed the connection]
<jackdaniel> rather: minimal was clarified, and both are permissible
<phoe> oh!
<phoe> Status: proposal MINIMAL, as amended, passed Mar 89 X3J13 by vote of 11-5.
<jackdaniel> uhm, both were proposed but one was accept, ok
<jackdaniel> thanks
aeth has quit [Ping timeout: 240 seconds]
aeth has joined #lisp
ggole has joined #lisp
dbotton__ has joined #lisp
Stanley00 has quit []
dbotton has quit [Ping timeout: 256 seconds]
_jrjsmrtn has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 240 seconds]
alxplorer has quit [Remote host closed the connection]
treflip has quit [Remote host closed the connection]
EvW has joined #lisp
mmohammadi981266 has joined #lisp
mmohammadi981266 has quit [Client Quit]
mmohammadi981266 has joined #lisp
mmohammadi981266 has quit [Client Quit]
emys has quit [Ping timeout: 260 seconds]
emys has joined #lisp
mmohammadi981266 has joined #lisp
decentyousername has quit [Remote host closed the connection]
mmohammadi981266 has quit [Client Quit]
frgo has joined #lisp
emys has quit [Ping timeout: 264 seconds]
emys has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
jonatack has quit [Ping timeout: 258 seconds]
contrapunctus has joined #lisp
alxplorer has joined #lisp
nullman has quit [Ping timeout: 240 seconds]
kilimanjaro has quit [Ping timeout: 264 seconds]
buoy49 has quit [Ping timeout: 258 seconds]
buoy49 has joined #lisp
kilimanjaro has joined #lisp
davepdotorg has quit [Remote host closed the connection]
davepdotorg has joined #lisp
contrapunctus has quit [Ping timeout: 260 seconds]
davepdotorg has quit [Ping timeout: 246 seconds]
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #lisp
contrapunctus has joined #lisp
orivej has quit [Ping timeout: 246 seconds]
saganman has quit [Quit: WeeChat 1.6]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
emys has quit [Ping timeout: 272 seconds]
stux|RC has quit [Quit: Aloha!]
emys has joined #lisp
stux|RC has joined #lisp
stux|RC has quit [Client Quit]
stux|RC has joined #lisp
mmohammadi981266 has joined #lisp
sts-q has quit [Ping timeout: 240 seconds]
frost-lab has quit [Quit: Connection closed]
davepdotorg has joined #lisp
mmohammadi981266 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
mmohammadi981266 has joined #lisp
saganman has joined #lisp
saganman has joined #lisp
saganman has quit [Changing host]
davepdotorg has quit [Ping timeout: 272 seconds]
bitmapper has quit [Quit: Connection closed for inactivity]
madage has quit [Remote host closed the connection]
sts-q has joined #lisp
sword865 has quit [Quit: Connection closed for inactivity]
davepdotorg has joined #lisp
random-nick has quit [Quit: quit]
notzmv has quit [Read error: Connection reset by peer]
madage has joined #lisp
random-nick has joined #lisp
dilated_dinosaur has quit [Remote host closed the connection]
orivej has joined #lisp
xrash has joined #lisp
Inline has joined #lisp
saganman has quit [Ping timeout: 272 seconds]
ebrasca has joined #lisp
mankaev has joined #lisp
mankaev_ has quit [Read error: Connection reset by peer]
notzmv has joined #lisp
emys has quit [Ping timeout: 256 seconds]
dilated_dinosaur has joined #lisp
iissaacc has quit [Ping timeout: 260 seconds]
emys has joined #lisp
mmohammadi981266 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
emys has quit [Ping timeout: 246 seconds]
dbotton__ has quit [Quit: -a- Connection Timed Out]
dbotton has joined #lisp
emys has joined #lisp
jonatack has joined #lisp
lowryder has joined #lisp
emys has quit [Ping timeout: 246 seconds]
gaqwas has joined #lisp
Bike has joined #lisp
davepdotorg has quit [Remote host closed the connection]
davepdotorg has joined #lisp
jonatack has quit [Ping timeout: 260 seconds]
xrash has quit [Read error: Connection reset by peer]
jonatack has joined #lisp
mmohammadi981266 has joined #lisp
davepdotorg has quit [Ping timeout: 240 seconds]
emys has joined #lisp
froggey has quit [Ping timeout: 260 seconds]
Alloc has quit [Ping timeout: 256 seconds]
luis75 has joined #lisp
luis752 has joined #lisp
luis75 has quit [Remote host closed the connection]
luis752 is now known as luis75
Alloc has joined #lisp
kaftejiman has joined #lisp
luis752 has joined #lisp
edgar-rft has joined #lisp
froggey has joined #lisp
davepdotorg has joined #lisp
scymtym has quit [Ping timeout: 260 seconds]
emys has quit [Ping timeout: 246 seconds]
Necktwi has joined #lisp
mmohammadi981266 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
mmohammadi981266 has joined #lisp
nullman has joined #lisp
mmohammadi981266 has quit [Quit: Ping timeout (120 seconds)]
mmohammadi981266 has joined #lisp
shifty has quit [Ping timeout: 264 seconds]
amb007 has quit [Read error: Connection reset by peer]
Alloc has quit [Ping timeout: 256 seconds]
amb007 has joined #lisp
Alloc has joined #lisp
defunkydrummer has joined #lisp
lowryder has quit [Read error: Connection reset by peer]
u0_a199 has joined #lisp
Gerula has quit [Ping timeout: 240 seconds]
jesse1010 has quit [Quit: Leaving]
EvW has quit [Ping timeout: 240 seconds]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
mmohammadi981266 has quit [Read error: Connection reset by peer]
contrapunctus has joined #lisp
dbotton__ has joined #lisp
rumbler31 has quit [Read error: Connection reset by peer]
dbotton has quit [Ping timeout: 240 seconds]
aeth has quit [Ping timeout: 256 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
u0_a199 has quit [Read error: Connection reset by peer]
u0_a199 has joined #lisp
scymtym has joined #lisp
u0_a199 has quit [Read error: Connection reset by peer]
amb007 has quit [Read error: Connection reset by peer]
dbotton__ has quit [Ping timeout: 272 seconds]
amb007 has joined #lisp
rumbler31 has joined #lisp
dbotton has joined #lisp
skapata has joined #lisp
aeth has joined #lisp
u0_a199 has joined #lisp
kiroul has joined #lisp
u0_a1991 has joined #lisp
bitmapper has joined #lisp
alxplorer has quit [Remote host closed the connection]
Cymew has quit [Ping timeout: 260 seconds]
alxplorer has joined #lisp
u0_a199 has quit [Ping timeout: 246 seconds]
alxplorer has quit [Ping timeout: 246 seconds]
defunkydrummer has quit [Quit: Leaving]
defunkydrummer has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
davepdotorg has quit [Remote host closed the connection]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
davepdotorg has joined #lisp
narimiran has joined #lisp
contrapunctus has joined #lisp
dbotton__ has joined #lisp
dbotton has quit [Read error: Connection reset by peer]
davepdotorg has quit [Ping timeout: 272 seconds]
alxplorer has joined #lisp
amb007 has quit [Ping timeout: 258 seconds]
amb007 has joined #lisp
edgar-rft has quit [Quit: Leaving]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
davepdotorg has joined #lisp
davepdotorg has quit [Ping timeout: 264 seconds]
davepdotorg has joined #lisp
aaaaaa has joined #lisp
davepdotorg has quit [Ping timeout: 260 seconds]
davepdotorg has joined #lisp
alxplorer has quit [Remote host closed the connection]
alxplorer has joined #lisp
dbotton__ has quit [Read error: Connection reset by peer]
davepdotorg has quit [Ping timeout: 240 seconds]
dbotton has joined #lisp
hendursaga has quit [Ping timeout: 240 seconds]
alxplorer has quit [Ping timeout: 258 seconds]
lowryder has joined #lisp
drot has quit [Ping timeout: 240 seconds]
chrpape has quit [Ping timeout: 240 seconds]
drot has joined #lisp
hendursaga has joined #lisp
Lycurgus has joined #lisp
Balooga has quit [Read error: Connection reset by peer]
Balooga has joined #lisp
decentyousername has joined #lisp
frgo has quit [Remote host closed the connection]
wsinatra has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
jasom has quit [Quit: WeeChat 2.8]
amb007 has quit [Read error: Connection reset by peer]
Inline has quit [Ping timeout: 272 seconds]
amb007 has joined #lisp
arpunk has joined #lisp
arpunk has quit [Read error: Connection reset by peer]
arpunk has joined #lisp
alxplorer has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
Gerula has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
todun has joined #lisp
niceplace has joined #lisp
jprajzne1 has quit [Quit: Leaving.]
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
ebrasca has quit [Remote host closed the connection]
torbo has joined #lisp
Alloc has quit [Ping timeout: 260 seconds]
Alloc has joined #lisp
todun has quit [Quit: todun]
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
gravicappa has quit [Ping timeout: 246 seconds]
gravicappa has joined #lisp
frgo has joined #lisp
frgo_ has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
karlosz has joined #lisp
seok has joined #lisp
<seok> Morning
lowryder has quit [Remote host closed the connection]
Inline has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
dxtr has joined #lisp
cosimone has joined #lisp
EvW has joined #lisp
bocaneri has quit [Remote host closed the connection]
voidlily has quit [Ping timeout: 240 seconds]
voidlily has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
alxplorer has quit [Remote host closed the connection]
edgar-rft has joined #lisp
alxplorer has joined #lisp
rippa has joined #lisp
torbo has quit [Remote host closed the connection]
alxplorer has quit [Ping timeout: 256 seconds]
vaporatorius has joined #lisp
vaporatorius__ has quit [Ping timeout: 265 seconds]
dbotton has quit [Ping timeout: 256 seconds]
dbotton has joined #lisp
orivej has joined #lisp
dbotton__ has joined #lisp
frgo has joined #lisp
defunkydrummer has quit [Ping timeout: 256 seconds]
dbotton has quit [Ping timeout: 260 seconds]
seok has quit [Ping timeout: 245 seconds]
frgo_ has quit [Ping timeout: 240 seconds]
<aaaaaa> selwyn: evening (eastern EU)
* Lycurgus slams the UTC door on the way out
Lycurgus has quit [Quit: Exeunt]
ramHero has joined #lisp
lowryder has joined #lisp
alxplorer has joined #lisp
ggole has quit [Quit: Leaving]
supercoven has quit [Ping timeout: 258 seconds]
alxplorer has quit [Ping timeout: 258 seconds]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
shka_ has quit [Ping timeout: 260 seconds]
Steeve has joined #lisp
Inline has quit [Ping timeout: 272 seconds]
dbotton has joined #lisp
dbotton__ has quit [Read error: Connection reset by peer]
alxplorer has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
EvW has quit [Ping timeout: 244 seconds]
jello_pudding has quit [Ping timeout: 260 seconds]
alxplorer has quit [Ping timeout: 256 seconds]
u0_a1991 has quit [Read error: Connection reset by peer]
liberliver has quit [Ping timeout: 272 seconds]
EvW has joined #lisp
dyelar has quit [Quit: Leaving.]
contrapunctus has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
akoana has joined #lisp
amb007 has joined #lisp
gdsg has joined #lisp
cosimone has quit [Remote host closed the connection]
jw4 has quit [Read error: Connection reset by peer]
voidlily has quit [Remote host closed the connection]
jw4 has joined #lisp
voidlily has joined #lisp
alxplorer has joined #lisp
aeth_ has joined #lisp
dbotton has quit [Ping timeout: 240 seconds]
dilated_dinosaur has quit [Ping timeout: 256 seconds]
aeth has quit [Ping timeout: 260 seconds]
gaqwas has quit [Remote host closed the connection]
arpunk has quit [Read error: Connection reset by peer]
narimiran has quit [Ping timeout: 256 seconds]
aeth_ is now known as aeth
jello_pudding has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
rixard has quit [Read error: Connection reset by peer]
rixard has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
semz has joined #lisp
defunkydrummer has joined #lisp
jello_pudding has quit [Ping timeout: 260 seconds]
cosimone has joined #lisp
galex-713 has quit [Ping timeout: 272 seconds]
<phoe> beach: we got a YouTube question.
<phoe> "What stops one from taking the approach of traditional compiler bootstrapping, substituting 'basic' Lisp for machine code? We write all our macros and functions as we normally would, macroexpand them to our 'basic' Lisp subset which has no macro invocations and potentially a reduced set of special forms, and write an interpreter/compiler for the 'basic' Lisp. Then we only need to use a host CL implementation
<phoe> once for the macroexpansion."
gravicappa has quit [Ping timeout: 260 seconds]
wsinatra has quit [Quit: WeeChat 2.9]
galex-713 has joined #lisp
xrash has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
dbotton_ has quit [Quit: Leaving]
lowryder has quit [Remote host closed the connection]
dilated_dinosaur has joined #lisp
bilegeek has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
Nilby has quit [Read error: Connection reset by peer]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
jello_pudding has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
anewuser has joined #lisp
EvW has quit [Ping timeout: 240 seconds]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
xrash has quit [Ping timeout: 260 seconds]
Gerula has quit [Remote host closed the connection]
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
emys has joined #lisp
Inline has joined #lisp
xrash has joined #lisp
sonologico has joined #lisp
madage has quit [Ping timeout: 240 seconds]
madage has joined #lisp
EvW has joined #lisp
decentyousername has quit [Ping timeout: 272 seconds]
amb007 has quit [Ping timeout: 260 seconds]
malm has quit [Quit: Bye bye]
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
pve has quit [Quit: leaving]
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
Gerula has joined #lisp
srhm has quit [Read error: Connection reset by peer]
contrapunctus has joined #lisp
cosimone has quit [Remote host closed the connection]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
cosimone has joined #lisp
contrapunctus has joined #lisp
random-nick has quit [Ping timeout: 265 seconds]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
cosimone has quit [Remote host closed the connection]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
cosimone has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
jprajzne has quit [Quit: jprajzne]
contrapunctus has joined #lisp
jprajzne has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
cosimone has quit [Remote host closed the connection]
sonologico has quit [Remote host closed the connection]
<no-defun-allowed> That's a lot of tabs.
contrapunctus has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
<Bike> would you be so courteous as to explain what this is or why you're linking it
<Inline> sorry the pasting has caused some disalignment
<Inline> i was getting failures, which were because i was trying to specialize on &optional, which stassats told me over in #sbcl
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
<Bike> okay, and then you pasted it here a few minutes later, because?
<Inline> so (distance-origin p1) is the same as (distance p1 nil)
<Inline> Bike: what do you mean ?
<Inline> am i forbidden todo that ?
<phoe> no no, more like
<Bike> I'm just asking what you want help with, or what.
<phoe> what's the question you have
<Bike> We can't divine your intent based on just this code.
<Inline> why should i help, when it's me how needs it maybe ?
<Inline> whatever bike
contrapunctus has joined #lisp
<Bike> Am i out of line here? I would be happy to try to answer a question but I need to know what the question is.
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
<Inline> the question is already answered over in #sbcl, i just pasted the corrected code over here, because stassats meant it's maybe more related to #lisp
<Inline> so, there's that
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
<phoe> oh, okay
jcowan has joined #lisp
contrapunctus has joined #lisp
<phoe> ...except I don't think there was a conversation over here related to this code
<jcowan> Does anyone know of use cases for arrays whose shape includes a zero? They have no elements, but they are valid.
<jcowan> (other than vectors)
<Inline> do you mean sparse arrays ?
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
<phoe> I think he means arrays e.g. of dimensions (3 0 4)
<no-defun-allowed> Arrays where one dimension is zero, but have more than one dimension.
<Inline> isn't that sparse too ?
<phoe> nope, arrays aren't sparse in CL
<Inline> other then elementwise sparse it's row wise sparse or column wise sparse
<phoe> this means that the array has 3*0*4 elements inside it
<Inline> i mean the above
alxplorer has quit [Remote host closed the connection]
<phoe> uhh, no
<phoe> arrays aren't sparse in CL
<Inline> yeah
lucasb has joined #lisp
<phoe> (array-total-size (make-array '(0 3 4))) ;=> 0
<Inline> i suppose he asks for some special library which has such functionality or so
<phoe> jcowan: as for actual use cases... hm
contrapunctus has joined #lisp
jprajzne has quit [Quit: jprajzne]
<jcowan> Yes, dimensions like 3 0 4
<phoe> I assume that if one needs to handle user-provided array dimensions then having such arrays would be beneficial
jprajzne has joined #lisp
<phoe> e.g. if someone handles a situation where each shop can have a given number of each product, each with a given expiration date
<phoe> so e.g. 10 shops, 10 products, 10 possible expiration dates
<phoe> all user-input and such
<jcowan> They can't store anything, though; they are just shapes, which are just lists.
rgherdt has quit [Ping timeout: 272 seconds]
<phoe> then we would like a case where we have 0 products which effectively allocates a zero-total-size array
shifty has joined #lisp
<phoe> that's a stupid example but I think it's possible in real situations
<jcowan> I sure can't think of one.
* jcowan feels like a post-Roman trying to grasp Arabic numbers with their zero sign.
<phoe> maybe they are just there to take care of an edge case
<jcowan> I thought that was what exceptions were for. :-)
anewuser has quit [Remote host closed the connection]
<jcowan> I guess it's a generalization of a zero-length vector, which does make sense because vectors are sequences.
<phoe> I mean, we're now stepping into the zone named "should (make-array '(3 0 4)) signal an error or not"
<jcowan> (a fortiori, empty strings too)
<Bike> there are also zero rank arrays, which are silly.
<phoe> obviously they have a single element though
<jcowan> Those I can actually understand; they guarantee that the inner product of conformable arrays is an array.
<Bike> a silly element
anewuser has joined #lisp
<Bike> yeah, i wouldn't want them eliminated or anything
<no-defun-allowed> Those are convenient "boxes", which some people use conses for.
jprajzne has quit [Client Quit]
emys has quit [Quit: Leaving]
<jcowan> Although I would bet that conses have less overhead.
<no-defun-allowed> But with one element, you don't have to decide whether the CAR or the CDR holds the value. (Obviously the CAR though).
<Bike> the standard specifically allows zero dimensions, e.g. in the glossary entry for "valid array dimension"
jprajzne has joined #lisp
<jcowan> even in systems where they are not specially optimized.
<no-defun-allowed> Sure.
<Bike> "Such a fixnum must be greater than or equal to zero..."
<jcowan> Right, which is why I asked for use cases.
anewuser has quit [Remote host closed the connection]
<phoe> I mean, why would (make-array '()) have more elements than (make-array '(0))
<phoe> that was my first intuition
<Bike> because the empty product is 1
anewuser has joined #lisp
<Bike> but no, i don't know any use cases, other than for empty vectors which you already ruled out
amb007 has joined #lisp
<jcowan> so I guess it's just a generalization of that.
amb007 has quit [Read error: Connection reset by peer]
<phoe> Bike: yes, I understood it after a while
<Bike> yeah, i'd say it's just for regularity.
amb007 has joined #lisp
anewuser has quit [Remote host closed the connection]
<Bike> zero dimensions are also explicit in 15.1.1.2. still no detail on why though
anewuser has joined #lisp
<jcowan> CLtL is quite uninformative about arrays; mostly just a list of the functions and their domains and ranges.
<Inline> bah, this sucks, when trying to copy-paste from my console in sbcl repl, the shortcut C-c throws me into the debugger in the repl
alxplorer has joined #lisp
<phoe> use Ctrl+Shift+C in the terminal
<Inline> oh
<phoe> if you have a sane terminal, that is
<Inline> thank you
<Inline> i'll try that
<jcowan> Or Ctrl-Insert, if you have an Insert key
<phoe> C-c has a different meaning in Unix terminals since it sends a signal
<Bike> clhs doesn't say much about arrays either
<jcowan> Standards are intentionally short on rationale, but CLtL has quite a bit of it, especially if you read between the lines.
<Inline> works, thank you :)
<Bike> it does say that "internally a multidimensional array is stored as a one-dimensional array", which in my opinion it shouldn't
<phoe> shouldn't, why?
<jcowan> It took me a long time to from the older keychords to Ctrl-[XCV].
<jcowan> It might not be true in specific implementations.
<Bike> it's mandating an implementation strategy
<Bike> i mean in practice an implementor can ignore it, but still
<Inline> i know shift-Insert for pasting, but didn't know Ctrl-Insert for copying
<Inline> arright, learnt a new thing hehe
<Bike> compare e.g. with logbitp and stuff, which talk about treating an integer as being in two's complement binary regardless of what the implementation is "actually" doing
myall has joined #lisp
myall has joined #lisp
myall has quit [Changing host]
<jcowan> and Shift-Delete for cutting.
<Inline> aha
<Bike> (something that is relevant in practice, since bignums might be sign-magnitude)
<jcowan> Indeed, GMP and related libraries store the sign by negating the bigit count
<no-defun-allowed> It would be very strange to not store a multi-dimensional array as a one-dimensional array in row-major order, as displacement exposes that to some extent.
<Bike> strangeness isn't verboten
<no-defun-allowed> I suppose not doing that is possible, but it would probably be very hard.
pillton has quit [Ping timeout: 272 seconds]
<jcowan> Displacement would be awkward in the other reasonable system, vectors-of-vectors(-of...)
alxplorer has quit [Remote host closed the connection]
aaaaaa has quit [Quit: leaving]
<no-defun-allowed> A storage vector with column-major order would also be awkward.
edgar-rft has quit [Quit: Leaving]
<jcowan> That's just a transposition, which is an affine transformation, which means it can be made very efficient.
<no-defun-allowed> Right.
Steeve has quit [Quit: end]
<jcowan> because affine transformations are closed, so although you can't find the product in the general case unless you can ijntrospect on functions, you can definitely do it with a given list of transforms
<jcowan> such as extraction, translation, permutation, currying, reversal, tiling, rotation, and uniform sampling
<jcowan> to name just eight
<Inline> not being able to specialize on &optional, is that an implementation thing or a spec thing ?
<Bike> It is a spec thing.
<Inline> ok
<Inline> and you know the rationale behind it ?
<Bike> Well, for one thing, different methods on the same generic function can hae different defaults for optional parameters.
<Bike> the generic function itself does not provide a default, so it's not obvious what would be correct to dispatch to.
<phoe> if you really want to, you can work around this by (defun foo (bar &optional baz) (foo-internal bar baz)) (defgeneric foo-internal (bar baz))
<phoe> and optionally provide a default argument there
<aeth> I'll probably wind up abstracting over something like that with my DEFINE-FUNCTION-style macro family.
<Inline> ok thank you phoe
<Bike> Being able to provide different behavior for the post-required parameters is very useful, but mostly with &key rather than &optional, e.g. with make-instance
<aeth> It's a bit complicated because defgeneric/defmethod are two separate things.
<Bike> also, the syntax might be a little ugly since there's also the suppliedp variable. not that that couldn't be overcome.
Steeve has joined #lisp
<aeth> Bike: the syntax I've settled on is (variable default class-or-type suppliedp) where each one is optional after variable. Basically in order of how common it is. And besides, if you supply a class or type, you probably want a default other than nil (or an (error))
<aeth> (I say class-or-type because define-method would use class there, while define-function uses type there)
frgo has quit [Read error: Connection reset by peer]
frgo has joined #lisp
anddam has quit [Ping timeout: 256 seconds]
terpri_ is now known as terpri
orivej has quit [Ping timeout: 256 seconds]
EvW has quit [Ping timeout: 260 seconds]
justache has quit [Quit: Ping timeout (120 seconds)]
gum has quit [Ping timeout: 265 seconds]
justache has joined #lisp
anewuser has quit [Quit: Leaving]
perrier-jouet has quit [Ping timeout: 260 seconds]
sjl has quit [Ping timeout: 260 seconds]
tychoish has quit [Ping timeout: 260 seconds]
Christ0pher has quit [Ping timeout: 260 seconds]
Christ0pher has joined #lisp
ggoes has quit [Ping timeout: 260 seconds]
luna_is_here has quit [Ping timeout: 260 seconds]
pok has quit [Ping timeout: 260 seconds]
pok has joined #lisp
gdsg has quit [Remote host closed the connection]
luna_is_here has joined #lisp
ggoes has joined #lisp
xrash has quit [Ping timeout: 240 seconds]
tychoish has joined #lisp
sjl has joined #lisp
perrier-jouet has joined #lisp
anddam has joined #lisp
alxplorer has joined #lisp
torbo has joined #lisp