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.14, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
Zelmin has quit [Ping timeout: 252 seconds]
Lycurgus has quit [Quit: Exeunt]
patche has joined #lisp
patche has quit [Ping timeout: 250 seconds]
isBEKaml has quit [Quit: WeeChat 2.3]
patche has joined #lisp
patche has quit [Ping timeout: 244 seconds]
kirkwood has joined #lisp
kirkwood has quit [Remote host closed the connection]
kirkwood has joined #lisp
Zelmin has joined #lisp
elderK has joined #lisp
<elderK> Moin all!
hhdave has joined #lisp
patche has joined #lisp
<verisimilitude> Hello, elderK.
hhdave has quit [Ping timeout: 272 seconds]
patche has quit [Ping timeout: 246 seconds]
torbo has quit [Ping timeout: 250 seconds]
shifty has quit [Ping timeout: 244 seconds]
mrcom has quit [Read error: Connection reset by peer]
dale has quit [Quit: dale]
Kundry_Wag has joined #lisp
patche has joined #lisp
patche has quit [Ping timeout: 244 seconds]
patche has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
pierpal has joined #lisp
patche has quit [Ping timeout: 250 seconds]
pierpal has quit [Ping timeout: 268 seconds]
kajo has quit [Ping timeout: 252 seconds]
kajo has joined #lisp
mrcom has joined #lisp
notzmv has joined #lisp
hectorhonn has joined #lisp
<hectorhonn> morning everyone
anewuser has joined #lisp
Selwyn has quit [Ping timeout: 250 seconds]
orivej has quit [Ping timeout: 244 seconds]
Kundry_Wag has quit [Remote host closed the connection]
_whitelogger has joined #lisp
Essadon has quit [Quit: Qutting]
mrcom has quit [Read error: Connection reset by peer]
<jcowan> w-c-r it turns out was added as a cleanup issuem, along with the ability to pass conditions to restart-* operations, so it's not surprising that papers don't talk abou tit.
akoana has left #lisp ["Leaving"]
hhdave has joined #lisp
mrcom has joined #lisp
hhdave has quit [Ping timeout: 268 seconds]
shifty has joined #lisp
khisanth_ has quit [Ping timeout: 244 seconds]
dale has joined #lisp
robotoad has quit [Quit: robotoad]
khisanth_ has joined #lisp
pierpal has joined #lisp
iovec has joined #lisp
robotoad has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 272 seconds]
Lord_of_Life_ is now known as Lord_of_Life
slyrus1 has quit [Remote host closed the connection]
m0w has quit [Remote host closed the connection]
<beach> Good morning everyone!
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 250 seconds]
_whitelogger has joined #lisp
hhdave has joined #lisp
hhdave has quit [Ping timeout: 250 seconds]
robdog has joined #lisp
anewuser has quit [Ping timeout: 246 seconds]
sjl has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 246 seconds]
shka_ has joined #lisp
dale has quit [Quit: dale]
Zelmin has quit [Read error: Connection reset by peer]
APic has quit [Ping timeout: 245 seconds]
sindan has quit [Remote host closed the connection]
torbo has joined #lisp
APic has joined #lisp
torbo has quit [Quit: ERC (IRC client for Emacs 26.1)]
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
dddddd has quit [Remote host closed the connection]
rippa has joined #lisp
Kundry_Wag has joined #lisp
megalography has joined #lisp
Kundry_Wag has quit [Ping timeout: 240 seconds]
vlatkoB has joined #lisp
kirkwood has quit [Remote host closed the connection]
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
mrcom has quit [Read error: Connection reset by peer]
mrcom has joined #lisp
hectorhonn has quit [Quit: Page closed]
mrcom has quit [Read error: Connection reset by peer]
Kundry_Wag has joined #lisp
mrcom has joined #lisp
Kundry_Wag has quit [Ping timeout: 250 seconds]
milanj has joined #lisp
hhdave has joined #lisp
sjl has quit [Ping timeout: 250 seconds]
kirkwood has joined #lisp
kirkwood has left #lisp [#lisp]
hhdave has quit [Ping timeout: 250 seconds]
findiggle has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
findiggle has joined #lisp
orivej has joined #lisp
shka__ has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 272 seconds]
<splittist> good morning beach
pierpal has quit [Ping timeout: 268 seconds]
xkapastel has joined #lisp
themsay has quit [Ping timeout: 246 seconds]
hhdave has joined #lisp
Kundry_Wag has joined #lisp
hhdave has quit [Ping timeout: 245 seconds]
Kundry_Wag has quit [Ping timeout: 246 seconds]
kajo has quit [Ping timeout: 268 seconds]
kajo has joined #lisp
heisig has joined #lisp
Arcaelyx has quit [Quit: Textual IRC Client: www.textualapp.com]
yvy has joined #lisp
_whitelogger has joined #lisp
kajo has quit [Ping timeout: 250 seconds]
kajo has joined #lisp
orivej has quit [Ping timeout: 250 seconds]
orivej has joined #lisp
yvy has quit [Read error: Connection reset by peer]
thodg has joined #lisp
mathk has joined #lisp
<mathk> hello is there an implmenetation that can run on embedded device like the STM32 ?
<shka__> mathk: rule of thumb: you will need OS to run common lisp
<mathk> why that ?
<shka__> for instance, becuase OPEN exists
<shka__> anyway, CL is not geared towards embedded systems
<shka__> there are other lisps, though
jello_pudding has quit [Quit: Leaving]
<mathk> which ine ?
<mathk> one#
<shka__> i can't help, sorry
<shka__> i don't do embedded
<heisig> A friend of mine is quite fond of http://www.ulisp.com/.
shifty has quit [Ping timeout: 244 seconds]
kajo has quit [Ping timeout: 252 seconds]
kajo has joined #lisp
orivej has quit [Ping timeout: 246 seconds]
robdog has quit [Remote host closed the connection]
<LdBeth> Don't know if Franz Lisp suitable for embedded
kajo has quit [Ping timeout: 252 seconds]
kajo has joined #lisp
robotoad has quit [Quit: robotoad]
elderK has quit [Quit: WeeChat 1.9]
robdog has joined #lisp
robdog has quit [Ping timeout: 268 seconds]
varjag has joined #lisp
<jcowan> Chibi Scheme is specifically designed for embedding as well
<jcowan> as is Tinyscheme, but Chibi is faster, more complete, and no bigger when fully stripped down
kajo has quit [Ping timeout: 250 seconds]
kajo has joined #lisp
acolarh has quit [Ping timeout: 264 seconds]
acolarh has joined #lisp
<pjb> shka_: wrong. Movitz, Mezzano.
<pjb> shka_: also for other CL implementations, you usually need only a kernel, not a whole OS. cf. eg. https://www.informatimago.com/linux/emacs-on-user-mode-linux.html
orivej has joined #lisp
<shka__> pjb: at this point those implementations are OS itself actually...
<phoe> sure, both an OS and a Lisp implementation
<phoe> anyway, Common Lisp is pretty huge by embedded standards where you count all memory in kilobytes or even megabytes instead of gigabytes, and it may not be the best language for the job.
<phoe> Megabytes is the grey zone for me.
milanj has quit [Quit: This computer has gone to sleep]
<phoe> mathk: ^
<phoe> anyway, for other implementations: someone suggested uLisp and I think it runs on some of these devices
orivej_ has joined #lisp
orivej has quit [Read error: Connection reset by peer]
<shka__> it is not merely not other implementations
<shka__> it is whole different language
hhdave has joined #lisp
orivej_ has quit [Ping timeout: 245 seconds]
orivej has joined #lisp
hhdave has quit [Ping timeout: 244 seconds]
milanj has joined #lisp
kajo has quit [Ping timeout: 252 seconds]
kajo has joined #lisp
gigetoo has quit [Read error: No route to host]
gigetoo has joined #lisp
<phoe> right - s/implementations/Lisp dialects/
baskethammer has quit [Quit: WeeChat 1.9.1]
<phoe> also - I have implemented sjl's and PuercoPop's comments at https://github.com/sharplispers/split-sequence/pull/13
<phoe> If anyone else would like to review that code, please feel welcome to
kajo has quit [Ping timeout: 250 seconds]
kajo has joined #lisp
<pjb> phoe: Well, ok. 17.2.1 says "The consequences are unspecified if both a :test and a :test-not argument are supplied in the same call to F." and the rest of the rules ask for a function specifier argument, which NIL is not. So 1- :test nil is meaningless. and 2- ":test argument supplied" seem to mean ":test whatever", not ":test not-nil". So the original check was ok (even of implementations allow (:test nil :test-not 'f)). They
<pjb> return 1 from (find 1 (quote(2 3 1 4 5)) :test nil :test-not (function /=)), as unspecified consequence.
<phoe> pjb: hm. I see.
dale has joined #lisp
<phoe> What should I do in that case then? Should I error if both TEST and TEST-NOT are supplied, regardless of what they are?
<jcowan> IMO yes
<jcowan> this is precisely why :test-not is deprecated, because "because it's not clear what to do when both :TEST and :TEST-NOT are provided" (issue 345)
<phoe> pjb: jcowan: Fixed in e756edf
<pjb> Well what common implementations implement for this unspecified case, is that as long as one of them is NIL it's ok, it uses the other.
<phoe> pjb: well, that is what I was doing previously.
<pjb> Not really, previously you tested their presence, not their value.
<phoe> Both presence and value.
<pjb> Now you're anding their value and their presence. It's ok, but you can avoid testing the presence when you and the values.
<phoe> (That would break if both TEST and TEST-NOT would be NIL.)
<pjb> Oh, right!
<pjb> But since the default value is not NIL: (test #'eql test-p) (test-not nil test-not-p) you're good.
<phoe> Hm.
<pjb> (… :test nil) would be wrong anyways.
Lycurgus has joined #lisp
<phoe> I do not have unit tests for both TEST and TEST-NOT.
<phoe> Let me sum it up.
<phoe> TEST not provided, TEST-NOT not provided: all is good.
<phoe> Either TEST or TEST-NOT provided and a function designator, the other not provided: all is good.
<phoe> Both provided: error.
<pjb> Both provided and both not-nil.
<phoe> Okay. I'll work on this a little bit more in a second.
<phoe> Will do that in a few whiles - cannot focus now.
<pjb> I see those cases: https://pastebin.com/Fik3ELBK
<pjb> (specified/unspecified what-should-happen-by-clhs-or-imo test-case)
_whitelogger has joined #lisp
nchambers has joined #lisp
<phoe> pjb: sjl overhauled split-list-internal after I overhauled it.
<pfdietz> Yay duplication of effort!
<phoe> I made it linear; he made my code readable.
<phoe> pfdietz: actually it wasn't duplicated.
<pfdietz> Serial effort, even better
FreeBirdLjj has joined #lisp
razzy has quit [Ping timeout: 246 seconds]
hhdave has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
<phoe> pjb: fixed in 4d7b02c
hhdave has quit [Ping timeout: 246 seconds]
<phoe> Tests also added.
<LdBeth> Merry Christmas
<phoe> Goodness, that's a lot of tests we've added to SPLIT-SEQUENCE.
<phoe> It was literally seven unit tests - now it's over fifty checks plus a random fuzzer.
<phoe> (At least seven unit tests came from me using that fuzzer in the first place.)
pjb has quit [Remote host closed the connection]
nchambers has quit [Quit: WeeChat 2.2]
notzmv has quit [Ping timeout: 268 seconds]
notzmv has joined #lisp
X-Scale has quit [Read error: Connection reset by peer]
nowhere_man has joined #lisp
wigust- has joined #lisp
wigust has quit [Ping timeout: 272 seconds]
sindan has joined #lisp
xkapastel has joined #lisp
hhdave has joined #lisp
bradfonseca has joined #lisp
pjb has joined #lisp
Lord_of_Life_ has joined #lisp
dddddd has joined #lisp
Lord_of_Life has quit [Ping timeout: 245 seconds]
hhdave_ has joined #lisp
Lord_of_Life_ is now known as Lord_of_Life
hhdave has quit [Ping timeout: 246 seconds]
hhdave_ is now known as hhdave
zotan has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
nchambers has joined #lisp
libre-man has joined #lisp
pierpal has joined #lisp
mathk has quit [Quit: Page closed]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 244 seconds]
nowhere_man has quit [Ping timeout: 252 seconds]
gxt has quit [Ping timeout: 252 seconds]
yvy has joined #lisp
nchambers has quit [Ping timeout: 244 seconds]
aindilis has quit [Ping timeout: 272 seconds]
<phoe> Is there any utility function that takes a package and returns a list of all external symbols of that package?
hhdave has quit [Quit: hhdave]
<phoe> Well. Nothing better than a oneliner then, (uiop:while-collecting (collect) (do-external-symbols (symbol :closer-mop) (collect symbol)))
seok has joined #lisp
<seok> What does this mean? Symbol "CONFIG" not found in the ** package
<seok> trying to load a package with another local package dependency
<seok> SBCL on portacle
<beach> Just when you try to start Portacle?
<seok> a month ago?
<seok> maybe
<seok> I'm not sure
<beach> No, I mean, when do you see this message?
<seok> just now
<seok> package I am working on was doing fine
<beach> Does it happen when you install Portacle? When you execute it? When you use it in some way?
FreeBirdLjj has quit [Remote host closed the connection]
<phoe> seok: weird. What's the stacktrace of that error?
<seok> until I tried to load a function from another local package
<phoe> This would mean that you have **:config in your code
<beach> seok: I think you are confused.
<phoe> seok: what function did you try to load? Can you post its source code?
<seok> ok
<seok> pheo got it
<beach> seok: Neither functions not packages are loaded in Common Lisp.
<seok> I think
<seok> Let me have a look, might have a function named config
<phoe> Is your package named "**"?
FreeBirdLjj has joined #lisp
<seok> no, it is called neo4j
<seok> I just took it out to avoid confusion
<phoe> Oh.
<phoe> So, basically, package NEO4J does not have a symbol called CONFIG.[6~[6~[6~
<seok> ok,
<phoe> That's the error.
<seok> yes I made a symbol "configure" then called it with "config"
<seok> Thank you
<pjb> "CONFIG.[6~[6~[6~" is a strange name for a symbol, but ok.
<seok> Where do I define export definitions?
<phoe> pjb: my IRC client got a hiccup.
<phoe> seok: in the DEFPACKAGE form.
<seok> I use it to setup database credentials
<pjb> seok: you define definitions, and you export symbols.
<pjb> seok: so what you do you mean?
<phoe> (defpackage #:neo4j (:use ...) (:export #:config ...))
<seok> do I define export symbols in .asd?
<seok> made package with quickproject
<phoe> Nope
msb has quit [Ping timeout: 245 seconds]
<phoe> In the package.lisp file
<seok> package.lisp?
<seok> ok
<pjb> seok: you are confusing everything.
<phoe> If that's the default quickproject file.
<pjb> asdf is to define systems.
<seok> Yup
<seok> haha
<seok> Newbie here
<pjb> defpackage is to define packages.
<pjb> defun is to define functions.
<phoe> seok: welp, are you using some kind of book to guide you?
<pjb> All unrelated, orthogonal, independent.
<pjb> systems are made of inter-dependent files.
msb has joined #lisp
<phoe> minion: tell seok about pcl
<minion> seok: look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
<phoe> minion: tell seok about gentle
<minion> seok: direct your attention towards gentle: "Common Lisp: A Gentle Introduction to Symbolic Computation" is a smoother introduction to lisp programming. http://www.cs.cmu.edu/~dst/LispBook/
<phoe> Use PCL if you've done any programming before and Gentle otherwise.
<phoe> Since you've mentioned Neo4J, I am guessing the former.
FreeBirdLjj has quit [Ping timeout: 268 seconds]
<seok> Ok, it's working now
<seok> gees, you guys are super helpful
<seok> genius
<seok> Yes, I've been through some resources like gigamonkeys book
nchambers has joined #lisp
<phoe> seok: OK. PCL does not really describe ASDF AFAIK.
<seok> Ya, just learning as only as much as I need for my project
<phoe> Actually that's a good question. #lisp, what are the resources on learning ASDF?
<beach> "genii"?
<seok> I remember a lengthy ASDF resource somewhere online
<seok> I skipped reading it tho
<pjb> phoe: the asdf user manual. Quite good.
nchambers has left #lisp ["WeeChat 2.2"]
<phoe> pjb: OK - I'll recomend it to people.
<phoe> minion: tell phoe about ASDF.
<phoe> I think it's the canonical link to the manual.
razzy has joined #lisp
amerlyq has joined #lisp
marvin2 has quit [Ping timeout: 250 seconds]
rumbler31 has joined #lisp
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 250 seconds]
slyrus1 has joined #lisp
<phoe> beach: Is there a zipped form of your http://metamodular.com/CLOS-MOP/ website that I can browse locally?
<beach> Let me check...
<phoe> I am on a very spotty connection right now and I would rather download the whole website once and browse it offline rather than deal with the lags I have now.
<beach> Better, yet. There is a GIT repository: https://github.com/robert-strandh/CLOS-MOP-HTML
gxt has joined #lisp
<phoe> Perfect.
yvy has quit [Read error: Connection reset by peer]
ebrasca has quit [Remote host closed the connection]
ebrasca has joined #lisp
<phoe> Thanks!
slyrus1 has quit [Quit: slyrus1]
slyrus1 has joined #lisp
<shka_> phoe: wget can crawl
<phoe> shka_: oh right, that too.
gxt has quit [Ping timeout: 244 seconds]
seok has quit [Ping timeout: 256 seconds]
gravicappa has joined #lisp
gxt has joined #lisp
_heisig has joined #lisp
heisig has quit [Remote host closed the connection]
pierpal has quit [Read error: Connection reset by peer]
jtecca has joined #lisp
anamorphic has joined #lisp
rumbler31 has quit [Ping timeout: 256 seconds]
<anamorphic> Hi, I have an set of C functions that I'm hoping to wrap nicely in Lisp, but I barely know what I'm doing. There's a bunch of set/get-attrib-int, set/get-attrib-double, etc. and so I thought something like this would work nicely (defgeneric (setf attrib) (value foo bar) (:method (((value real) ..)) (set-attrib-float foo bar (coerce value 'double-float))) (:method (((value integer) ..)) (set-attrib-int foo bar (coerce value '(signe
<anamorphic> d-byte 32))))), but when getting the attrib's value, my function has too look like this: (defun attrib (foo bar type) ... (get-attrib foo bar)) where (type-of type) is something like (member (real intege)), e.g. (attrib foo "bar" 'real)
<anamorphic> Is it worth it doing it this way, or is it better to just provide some straightforward set-attrib-real, set-attrib-int etc. Lisp functions?
<phoe> anamorphic: I suggest https://github.com/rpav/cl-autowrap
nanoz has joined #lisp
<anamorphic> Yeah this is basically a level up from autowrap though, I think?
robotoad has joined #lisp
<phoe> Yes, I think I understood your question better after I read it two more times.
<phoe> I think you can use generic dispatch on Lisp types, if that abstraction suits your use case.
<phoe> (defmethod get-attrib (foo bar (type (eql 'real))) ...)
<anamorphic> Yeah I think so, I basically don't want to care what the type of the attribute is in Lisp land
<phoe> Getting attributes is going to be more troublesome though
<phoe> Do you have any kind of type information coming from the foreign library?
<phoe> Or is it literally 100% raw pointers?
<anamorphic> Like being able introspect whether the attribute is an int or real? Unfortunately, no
<phoe> Yuck.
<phoe> I wonder who would expose API like this, but then again, it's off-topic.
<phoe> Honestly, if you have raw pointers, then you already have API that you can query.
<phoe> As long as you are fine with using CFFI types.
<phoe> If you aren't, then you can wrap around this API and add your custom access functions.
<anamorphic> OK thanks for the tip about (foo bar (type (eql 'real))) ...) I hadn't occurred to me
<phoe> If I do (defclass bar (foo) ()), then FOO is defined to be a FORWARD-REFERENCED-CLASS, correct?
<phoe> If so, then, if I afterwards do (defclass foo () ()), the class FOO is then CHANGE-CLASS'd into a STANDARD-CLASS, correct?
Essadon has joined #lisp
themsay has joined #lisp
<pjb> probably.
amerlyq has quit [Quit: amerlyq]
<phoe> Are all instances of all instances of FUNCALLABLE-STANDARD-CLASS funcallable?
<phoe> That is, if I define a custom FUNCALLABLE-STANDARD-CLASS, and then create instances of that class, are they supposed to be funcallable?
warweasle has joined #lisp
<phoe> Wait, I mixed things up
resttime has joined #lisp
<phoe> An instance of FUNCALLABLE-STANDARD-CLASS is a class.
<phoe> An instance of that class is an object.
<phoe> Is that object funcallable?
<stylewarning> Lisp representation at 2m41s https://youtu.be/p8-rZOCn5rQ
<shka_> it should be
<shka_> phoe: but you can botch your code
<phoe> shka_: botch? What do you mean?
<phoe> stylewarning: oh look I know that guy at 2:41
<shka_> inproper initialization of your instance
<shka_> or lack thereof
<phoe> As long as I SET-FUNCALLABLE-INSTANCE-FUNCTION on it, I should be fine funcalling it
<shka_> indeed
yvy has joined #lisp
<shka_> but it is perhaps easier and more idiomatic to supply class in the defgeneric
<pjb> even funcallable functions can fail at being called:
<pjb> (funcall (function sin) "foo") #| ERROR: The value "foo" is not of the expected type number. |#
<shka_> this would elevate the need of explicit initialization
<pjb> Granted it doesn't say "Couldn't call function sin", but still.
<shka_> technically speaking function was called, but it did not return i think :-)
<phoe> shka_: I'm diving into the MOP right now - I need to leave my idioms at the door for the time being.
<shka_> very well
Kundry_Wag has joined #lisp
<phoe> Is it idiomatic for a funcallable instance function to close over the funcallable instance itself?
<phoe> It doesn't make any other sense for me otherwise.
<phoe> Like, it wouldn't be possible for the function to access the instance otherwise.
<shka_> there is use for that
_heisig is now known as heisig
<shka_> for instance, you can defmethod dispatch on your function class itself
themsay has quit [Ping timeout: 272 seconds]
<shka_> therefore you can have abstract class like destructive-function
Kundry_Wag has quit [Ping timeout: 245 seconds]
<shka_> from there you can build your own custom operation invocation protocol
<shka_> for instance in cl-ds there is this generic function called position-modification
<shka_> all high level functions like INSERT or ADD call this function passing itself as a argument
<shka_> since there is a hierarchy of operations (destructive-grow, destructive-shrink etc.) specific strategy of performing said operation can be picked accordingly
<shka_> also, since instance of function is still available in the position-modification implementation, other low level methods can also dispatch on it
yvy has quit [Read error: Connection reset by peer]
<shka_> so for instance since UPDATE is supposed to fail when object is not in dictionary, implementation of make-bucket dispatching on UPDATE will signal that operation has failed and bucket was not created
<shka_> obviously same could be done with keeping instances that are dispatched on separate to the functions, but it is more convenient to keep those together
<shka_> less objects to juggle around
<shka_> phoe: does that help?
<phoe> shka_: yes
<phoe> thanks for that
<shka_> ok, awesome
<shka_> phoe: oh, also you can automate creating specific implementation by using shared-initialize, but that's quite obvious i think
marvin2 has joined #lisp
<shka_> even calling compile at this point can be good idea
<shka_> it is pretty neat stuff with lots of possibilities
jtecca has quit [Ping timeout: 246 seconds]
gravicappa has quit [Read error: Connection reset by peer]
yvy has joined #lisp
<phoe> What is the mechanism that binds together metaclasses and instance classes? I mean, STANDARD-CLASS and STANDARD-OBJECT, FUNCALLABLE-STANDARD-CLASS and FUNCALLABLE-STANDARD-OBJECT come to mind.
bradfonseca has quit [Quit: Konversation terminated!]
<phoe> I haven't worded that clearly enough. Class metaclasses and instance metaclasses, I mean.
torbo has joined #lisp
<phoe> If I make an instance of STANDARD-CLASS, how does MAKE-INSTANCE know that I want a STANDARD-OBJECT?
CrazyEddy has quit [Ping timeout: 250 seconds]
anamorphic has quit [Ping timeout: 245 seconds]
<heisig> phoe: If you make an instance of STANDARD-CLASS, you get an instance of STANDARD-CLASS :)
<phoe> ...
<phoe> You're right
<phoe> The circularities are really getting to me here
Kundry_Wag has joined #lisp
<heisig> I know that feeling. It really takes time to get used to it.
<phoe> But when I make an instance of an instance of STANDARD-CLASS, I get a STANDARD-OBJECT.
<phoe> Where is that behavior specified? Why didn't I get a FUNCALLABLE-STANDARD-OBJECT?
pierpal has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
<phoe> I know that I could have specified :METACLASS in DEFCLASS, but that's the CL way. I want to figure out where the trigger is in the MOP.
mrcom has quit [Read error: Connection reset by peer]
<shka_> phoe: standard-class and standard-object is kinda a primitive
<phoe> Obviously not primitive enough for my mind to comprehend them yet.
Kundry_Wag has quit [Ping timeout: 268 seconds]
<shka_> primitive in the sense that they are the implementation baseline
<shka_> you can't go below that
<phoe> Yes, but I am not interested in going below
<phoe> I am trying to understand going above that.
<shka_> ah, so you want to know what decides what type of the instance is allocated for the class
<phoe> Yes
<phoe> Ideally, I would like some code that defines a NON-STANDARD-CLASS that pops out NON-STANDARD-OBJECTs when given as an argument to MAKE-INSTANCE.
<phoe> All MOP-style, without DEFCLASS.
<phoe> Because right now I do not understand that process.
<shka_> first of, defclass is just syntax sugar
<shka_> secondly
<phoe> It calls ENSURE-CLASS, that is correct.
<shka_> check allocate-instance
<shka_> note that this is supposed to return uninitialized instance of a class
orivej has quit [Ping timeout: 245 seconds]
<shka_> therefore it essentially acts as a point of dispatch you are looking for
<shka_> if you want to add extra stuff into instance you can do it here, but it is usually not the best idea to do so
<shka_> more often you simply create pair of base-class and metaclass and user is supposed to explicitly use both
<shka_> phoe: that helps?
<phoe> shka_: kind of
<phoe> How does ALLOCATE-INSTANCE know what kind of instance to allocate?
<shka_> it has class
mrcom has joined #lisp
<shka_> so you have defmethod allocate-instance with standard-class and from there it is magic
nanoz has quit [Ping timeout: 240 seconds]
<shka_> from what i understand implementation may either use same code for each class
<shka_> however it is more likely that concrete version of method is added during initialization of the metaclass
mrcom has quit [Read error: Connection reset by peer]
<heisig> phoe: ALLOCATE-INSTANCE simply allocates an instance of the supplied class. This class has, like every Lisp object, a reference to its own class (CLASS-OF).
<shka_> so for instance if you would want to reimplement this yourself you would add new method to allocate-instance specialized on the your metaclass
torbo has quit [Remote host closed the connection]
sjl has joined #lisp
<shka_> heisig: why would you need such reference though, it is a method :-)
<shka_> anyway, how standard-object looks underneath and therefore how exactly it is allocated is implementation specific
<heisig> phoe: To get an instance of a subclass of FUNCALLABLE-STANDARD-OBJECT, this class usually needs to have FUNCALLABLE-STANDARD-CLASS as its metaclass.
nowhere_man has joined #lisp
<phoe> Hmm.
<heisig> shka_: You typically won't need it. I'm just saying it would be there if you want it.
<shka_> right
<phoe> So let's assume that I have a class NON-STANDARD-CLASS that is a subclass of STANDARD-CLASS.
<shka_> ok
<shka_> go one
<phoe> Now making an instance of NON-STANDARD-CLASS yields an object having NON-STANDARD-CLASS as its class.
<shka_> indeed
<phoe> Now making an instance of that thing yields an object having that thing as its class and NON-STANDARD-CLASS as its metaclass.
<shka_> yup
<shka_> and the instance is standard-object at this point because you did not touch allocate-instance
<phoe> Yes.
<shka_> so you are inheriting the standard behavior
<phoe> I would need to (defmethod allocate-instance ((class non-standard-class)) ...) in order to return an instance of NON-STANDARD-OBJECT.
<shka_> ah, even worse!
<shka_> phoe: you will need to add new method for each instance of your non-standard-class
mrcom has joined #lisp
<phoe> huh? really?
<shka_> if you want to inherit standard-object logic and just add a slot, yes
pierpal has quit [Read error: Connection reset by peer]
<shka_> if not, you can do as you wish
pierpal has joined #lisp
<shka_> that's why i said that adding pair of base-class and metaclass is a better approach overall
<shka_> a lot less convoluted
pierpal has quit [Read error: Connection reset by peer]
<shka_> and the end result is essentially the same
pierpal has joined #lisp
<heisig> clhs standard-object
<heisig> phoe: " The class standard-object is an instance of standard-class and is a superclass of every class that is an instance of standard-class except itself."
<shka_> it is just better to not tinker with it
<phoe> heisig: I see.
<shka_> you are not getting anything useful here
<phoe> So, basically, there are two hierarchies that the MOP concerns itself with: standard-objects, and funcallable-standard-objects.
<phoe> And not much more than that.
<shka_> isn't funcallable-standard-object also a standard-object?
<shka_> with like extra slot for a function
<shka_> yes it is
pierpal has quit [Read error: Connection reset by peer]
anamorphic has joined #lisp
<heisig> phoe: To avoid creating standard-objects, you need to have a class that is not a subclass of standard-class. Which is a lot of work.
<shka_> while function is just fundamental albstract class
pierpal has joined #lisp
<heisig> Anyway, I'm off for today. Bye.
<shka_> heisig: bye
heisig has quit [Quit: Leaving]
nowhere_man has quit [Ping timeout: 252 seconds]
<phoe> Thanks - bye.
<shka_> phoe: a little to late for that :D
<phoe> better late than never
<shka_> heh
<shka_> phoe: i will be going AFK, you are all fine now?
dale has quit [Quit: dale]
<phoe> I hope so
<phoe> shka: thanks for the support!
<shka_> cool
resttime has quit [Quit: Leaving]
<phoe> Oh
<phoe> I know why I was confused
<phoe> FUNCALLABLE-STANDARD-OBJECT is a subclass of STANDARD-OBJECT
<phoe> but FUNCALLABLE-STANDARD-CLASS is *NOT* a subclass of STANDARD-CLASS
Lycurgus has quit [Quit: Exeunt]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 250 seconds]
anamorphic has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
dale has joined #lisp
anamorphic has joined #lisp
shka_ has quit [Ping timeout: 250 seconds]
<sjl> clhs open
<sjl> > element-type---a type specifier for recognizable subtype of character; or a type specifier for a finite recognizable subtype of integer; or one of the symbols signed-byte, unsigned-byte, or :default.
<sjl> what does :element-type 'unsigned-byte mean?
<sjl> implementation specific?
<PuercoPop> > denotes the same type as is denoted by the type specifier (integer 0 *).
<sjl> Hmm
<phoe> When element-type is a subtype of integer, read-byte and/or write-byte can be used on the resulting file stream.
<phoe> unsigned-byte is a subtype of integer
Kundry_Wag has joined #lisp
<sjl> so if I open a stream with :element-type 'unsigned-byte and then (read-byte) I can potentially get back the entire contents of the file as one giant integer?
<phoe> sure, why not
<PuercoPop> yeah, but you can do (unsigned-byte 8)
<PuercoPop> to make sure you get them 8 bits at a time
<phoe> your implementation may choose the byte size then
<sjl> Yeah I know I can specify the bits... I was just wondering what the bare symbols are supposed to mean
<sjl> sbcl appears to choose (unsigned-byte 8) when given the bare symbol
<PuercoPop> btw byte in the context of CLHS has the older meaning of 'group of bits' not 8 bits
<sjl> Yeah, I know
<PuercoPop> sjl: I'm looking for the meaning of (integer 0 *)
<phoe> I think it's basically "give me any kind of integers as long as they are nonnegative
<PuercoPop> but the link of the CLHS for * points to the wrong entry afaik
<sjl> (integer 0 *) means all integers >= 0
<phoe> note that "type specifier for a finite recognizable subtype of integer" and 'unsigned-byte are not one and the same
<phoe> finite requires that * is not the third element of the type specifier
<sjl> phoe: right, because unsigned-byte is infinite
<phoe> it might be (integer 0 999999...99999999) but still, that's finite
<phoe> type specifiers are described on the pages for individual types and classes
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Kundry_Wag has quit [Ping timeout: 240 seconds]
<sjl> I'm trying to figure out a good way to sanity check that something is a binary input stream of element-type (unsigned-byte 8) at an API boundary
<sjl> what's complicating things is e.g. SBCL's *standard-output* having an element-type of character, but still allowing you to (write-byte ...) to it
<PuercoPop> phoe: but that entry just say it defaults to upper-limit, not what is the upper-limit of if the upper-limit is implementation specific
<sjl> I should probably just give up, and document what it takes, and let the error from (write-byte ...) bubble up to the user if they pass something that can't write bytes
dale has quit [Quit: dale]
<phoe> sjl: input-stream-p + stream-element-type
<phoe> as for SBCL, *standard-output* is likely a bivalent stream
<sjl> phoe: doesn't work on *standard-input* for sbcl like I just said
milanj has joined #lisp
<phoe> sjl: I see
<phoe> I'd ask #sbcl if there is any SBCL internal function for checking if a stream is bivalent.
<phoe> Because the standard function STREAM-ELEMENT-TYPE cannot return multiple type specifiers, it seems
<sjl> I can (check-type ... stream) and (assert (output-stream-p ...))) to do some basic stuff, but as far as I can tell there's no portable way to ask "can I call (write-byte ...) on this stream with (unsigned-byte 8) values?"
<phoe> In particular, it cannot output :default
<sjl> clhs write-byte
<sjl> > Might signal an error of type type-error if byte is not an integer of the stream element type of stream.
<phoe> Yes, I see
* sjl slowly zooms in camera on the word "Might" until it fills the screen
<sjl> MIGHT?
<sjl> fantastic.
<_death> "This means that the situation has undefined consequences; however, if an error is signaled, it is of the specified type. For example, ``open might signal an error of type file-error.''"
<_death>
<_death>
<phoe> sjl: #sbcl tells me there's no implementation-defined way of checking that.
<sjl> I guess I either get to choose flexibility (just try write-byte and hope for the best) or safety (check element-type, possibly excluding streams that could potentially work fine)
<phoe> And asks why you want to do that in the first place
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
thodg has quit [Ping timeout: 250 seconds]
<sjl> I'd prefer to not try to do too much implementation-specific hackery, even if it's possible
<sjl> I think write-byte and hope for the best is probably what I'll go with for this library
<_death> phoe: for a bivalent stream, (or (unsigned-byte 8) character) could work I guess
<phoe> why cannot you excluvisively accept binary streams then?
<phoe> if a user passes something that cannot accept binary i/o, it's their problem
<phoe> _death: hmmm
Arcaelyx has joined #lisp
gxt has quit [Ping timeout: 244 seconds]
<sjl> phoe: if I (assert (subtype (stream-element-type s) '(unsigned-byte 8)) or something, then I'd prevent a user from passing *standard-input/output* in SBCL
<sjl> and passing stdin/stdout is particularly useful for this thing
<phoe> sjl: don't assert it in code
<phoe> assert it in documentation
<sjl> well yeah, I did that long ago
<phoe> and say behavior is undefined otherwise
<_death> sjl: you should rotatef the subtypep arguments
<_death> you can say you might signal a type-error :)
<sjl> haha
gxt has joined #lisp
terpri has quit [Quit: Leaving]
yvy has quit [Read error: Connection reset by peer]
akoana has joined #lisp
pierpal has quit [Ping timeout: 250 seconds]
vlatkoB has quit [Remote host closed the connection]
m0w has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
milanj has quit [Quit: This computer has gone to sleep]
<dim> is there a way to force some double-buffering in McCLIM?
aindilis has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
aindilis has quit [Remote host closed the connection]
aindilis has joined #lisp
ebrasca has quit [Remote host closed the connection]
nowhere_man has joined #lisp
<margaritamike> Hello. What are the repos for Common Lisp that are similar to r-studio and jupyter? I've forgotten what they are.
nowhere_man has quit [Ping timeout: 252 seconds]
<PuercoPop> margaritamike: there is a cl-jupyter which is literally a jupyter notebook
<margaritamike> There is another one or two though. I've forgotten the name.
<margaritamike> It has like an ascii computer printed on its github page.
<PuercoPop> iniamathi has their own take notebooks