<emaczen>
Is CFFI just a portability library using the FFI of whatever CL implementation is being used?
Kundry_Wag has quit [Remote host closed the connection]
<luis>
CFFI-SYS is a portability layer. And then CFFI implements a bunch of features on top of that.
<emaczen>
luis: Okay, so most of it is portability
<aeth>
CLers take portability very seriously
<void_pointer>
emaczen: if you want to see how cffi-sys uses the features of whatever implementation it is on (out of a particular list), take a look at the different implementation specific files in https://github.com/cffi/cffi/tree/master/src
<luis>
emaczen: the 13 CFFI-SYS backends combined are 5k lines out of 20k lines in CFFI total
<luis>
so I wouldn't say most of it is portability :)
lyf[kde] has quit [Remote host closed the connection]
lyf[kde] has joined #lisp
lyf[kde] has quit [Remote host closed the connection]
robotoad has joined #lisp
<emaczen>
How do cffi:defcvar cffi:defcfun and cffi:defcstruct work and how does C expose variables, functions and structs so that we can interface?
<Bike>
in the shared library. usually the lisp uses something like dlsym
<Bike>
i think.
noark9 has quit [Quit: noark9]
lavaflow has quit [Read error: Connection reset by peer]
<emaczen>
Would the information I am looking for be in the cffi-sys interface specification?
lavaflow has joined #lisp
<luis>
That's a bit of a broad question. Can you be more specific?
<jcowan>
Well, the spec is not a wretched hive of scum and villainy, if that's what you mean.
<Bike>
i don't know what information you're looking for
robotoad has quit [Quit: robotoad]
lumm has quit [Quit: lumm]
ryan_vw has joined #lisp
<p_l>
emaczen: usually whatever the operating environment has for dynamic symbol resolution, which gives back pointer, which is wrapper appropriately for the Lisp code
nokdoot has quit [Ping timeout: 252 seconds]
nokdoott has joined #lisp
_whitelogger has joined #lisp
robotoad has joined #lisp
robotoad has quit [Quit: robotoad]
<emaczen>
I wish to know how defcvar defcstruct and defcfun work
<emaczen>
And what system facilities on the C side let them work
<Bike>
basically dlsym
robotoad has joined #lisp
noark9 has joined #lisp
atgreen_ has quit [Remote host closed the connection]
atgreen_ has joined #lisp
beach has joined #lisp
<beach>
Good morning everyone!
noark9 has quit [Quit: noark9]
<jgkamat>
morning beach :)
noark9 has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
ryan_vw has quit [Ping timeout: 264 seconds]
noark9 has quit [Quit: noark9]
orivej has quit [Ping timeout: 272 seconds]
igemnace has quit [Read error: Connection reset by peer]
<emaczen>
morning beach
kristof has joined #lisp
beach has quit [Disconnected by services]
beach has joined #lisp
igemnace has joined #lisp
nicdev has joined #lisp
nly has quit [Read error: Connection reset by peer]
nly has joined #lisp
kristof has quit [Quit: WeeChat 2.1]
nlyy has joined #lisp
<ebrasca>
Hi
nly has quit [Ping timeout: 272 seconds]
kristof has joined #lisp
nanoz has joined #lisp
nlyy has quit [Read error: Connection reset by peer]
<ski>
minion: advice for specbot
<minion>
specbot: #11911: You wrote the same thing twice here. The cardinal rule of programming is that you never ever write the same thing twice.
nly has joined #lisp
<ebrasca>
minion: advice
<minion>
#11918: Well, then get one that *does* do auto-indent. You can't do good work with bad tools.
nly has quit [Ping timeout: 272 seconds]
<ebrasca>
minion: advice krystof
wintertot has joined #lisp
igemnace has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
elderK has joined #lisp
nowhere_man has quit [Ping timeout: 252 seconds]
nowhereman_ has joined #lisp
elfmacs has quit [Ping timeout: 252 seconds]
pierpal has quit [Read error: Connection reset by peer]
nowhereman_ has quit [Read error: Connection timed out]
nowhereman_ has joined #lisp
arescorpio has joined #lisp
slyrus1 has quit [Ping timeout: 240 seconds]
Bike has quit [Quit: Lost terminal]
zigpaw has quit [Remote host closed the connection]
dented42 has joined #lisp
arescorpio has quit [Quit: Leaving.]
nly has joined #lisp
nokdoott has quit [Remote host closed the connection]
nokdoot has joined #lisp
nokdoot has quit [Max SendQ exceeded]
nokdoot has joined #lisp
azimut has joined #lisp
nokdoot has quit [Max SendQ exceeded]
nanozz has joined #lisp
nokdoot has joined #lisp
nly has quit [Read error: Connection reset by peer]
azimut_ has quit [Ping timeout: 244 seconds]
nokdoot has quit [Read error: Connection reset by peer]
nokdoot has joined #lisp
nokdoot has quit [Max SendQ exceeded]
nokdoot has joined #lisp
nanoz has quit [Ping timeout: 246 seconds]
kristof has quit [Ping timeout: 252 seconds]
nly has joined #lisp
pierpal has joined #lisp
ggole has joined #lisp
ryan_vw has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
wintertot has quit [Quit: Tots out]
pierpal has joined #lisp
nly has quit [Read error: Connection reset by peer]
lnostdal has quit [Ping timeout: 252 seconds]
pierpal has quit [Ping timeout: 252 seconds]
kristof has joined #lisp
kristof has quit [Ping timeout: 264 seconds]
nly has joined #lisp
nly has quit [Read error: Connection reset by peer]
nly has joined #lisp
rippa has joined #lisp
elfmacs has joined #lisp
nlyy has joined #lisp
nly has quit [Ping timeout: 244 seconds]
<makomo>
morning
lnostdal has joined #lisp
asarch_ has quit [Quit: Leaving]
<beach>
Hello makomo.
atgreen_ has quit [Remote host closed the connection]
smokeink has joined #lisp
pierpal has joined #lisp
Oladon has quit [Quit: Leaving.]
travv0 has quit [Quit: Connection closed for inactivity]
kristof has joined #lisp
doubledup has joined #lisp
doubledup has quit [Max SendQ exceeded]
doubledup has joined #lisp
ebrasca has quit [Remote host closed the connection]
kristof has quit [Ping timeout: 250 seconds]
kristof has joined #lisp
vlatkoB has joined #lisp
kristof has quit [Ping timeout: 276 seconds]
elfmacs has quit [Read error: Connection reset by peer]
ryan_vw has quit [Ping timeout: 264 seconds]
travv0 has joined #lisp
random-nick has joined #lisp
zigpaw has joined #lisp
<meepdeew>
is there an easy way to bind cursor position within BIND-BUTTON for trivial-gamekit?
ryan_vw has joined #lisp
<meepdeew>
or rather, just access the value. Or in a case like this does one just store those coords anytime the mouse had moved previously and reuse that value?
<phoe>
meepdeew: #lispgames might be able to answer better
<meepdeew>
Crepes, I'm lost
varjag has joined #lisp
<meepdeew>
Definitely thought that's where I was. My apologies, folks.
ryan_vw has quit [Ping timeout: 264 seconds]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ryan_vw has joined #lisp
varjag has quit [Ping timeout: 245 seconds]
snits has quit [Ping timeout: 244 seconds]
plathrop has quit [Ping timeout: 244 seconds]
flip214 has quit [Ping timeout: 244 seconds]
emar has quit [Ping timeout: 244 seconds]
NB0X-Matt-CA has quit [Ping timeout: 244 seconds]
salva has quit [Ping timeout: 244 seconds]
energizer has quit [Ping timeout: 244 seconds]
patche has quit [Ping timeout: 244 seconds]
shelvick has quit [Ping timeout: 244 seconds]
borodust has quit [Ping timeout: 244 seconds]
energizer_ has joined #lisp
troydm has quit [Ping timeout: 272 seconds]
Nikotiini has quit [Ping timeout: 244 seconds]
K1rk has quit [Ping timeout: 244 seconds]
snits has joined #lisp
flip214 has joined #lisp
patche has joined #lisp
troydm has joined #lisp
emar has joined #lisp
NB0X-Matt-CA has joined #lisp
plathrop has joined #lisp
meepdeew has quit [Remote host closed the connection]
salva has joined #lisp
Nikotiini has joined #lisp
Tordek has quit [Remote host closed the connection]
Zaab1t has joined #lisp
<phoe>
(:
asymptotically has joined #lisp
beach has quit [Disconnected by services]
beach has joined #lisp
Nikotiini has quit [Ping timeout: 244 seconds]
Nikotiini has joined #lisp
doubledup has quit [Remote host closed the connection]
flazh has quit [Ping timeout: 244 seconds]
flazh has joined #lisp
<splittist>
morning
<beach>
Hello splittist.
shka_ has joined #lisp
<phoe>
Hey beach
<no-defun-allowed>
is there a way to make a bidirectional stream? i'd like to test how cl-decentralise reacts to some commands
<no-defun-allowed>
i'm guessing flexi-streams does something but i'm not sure what i want from it
nanozz has quit [Read error: Connection reset by peer]
Xach has quit [Ping timeout: 252 seconds]
Xach has joined #lisp
hiroaki has joined #lisp
nlyy has quit [Ping timeout: 252 seconds]
nly has joined #lisp
void_pointer has joined #lisp
knicklux has quit [Remote host closed the connection]
nly has quit [Read error: Connection reset by peer]
kristof has joined #lisp
kristof has quit [Ping timeout: 264 seconds]
nly has joined #lisp
doubledup has joined #lisp
doubledup has quit [Remote host closed the connection]
robotoad has quit [Quit: robotoad]
beach has quit [Disconnected by services]
beach has joined #lisp
papachan has joined #lisp
<knobo>
I suddenly realized that often I do (let ((key (getf var :key)) when I could have done (destructuring-bind (&key key &allow-other-keys) var..
<pjb>
The former is shorter.
<pjb>
and more to the point.
<pjb>
What you should have done if you do it often, is (defmacro with-key ((key-var plist) &body body) `(let ((,key-var (getf ,plist ,(intern (symbol-name key-var) "KEYWORD")))) ,@body)) and write (with-key (key var) …)
varjag has joined #lisp
robotoad has joined #lisp
giova has joined #lisp
solyd has joined #lisp
giova has left #lisp [#lisp]
kristof has joined #lisp
robotoad has quit [Quit: robotoad]
solyd has quit [Quit: solyd]
kristof has quit [Ping timeout: 250 seconds]
scymtym has quit [Ping timeout: 246 seconds]
shifty has joined #lisp
nly has quit [Ping timeout: 264 seconds]
nly has joined #lisp
Zaab1t has quit [Quit: bye bye friends]
scymtym has joined #lisp
Bike has joined #lisp
iskander has quit [Quit: Quit]
iskander has joined #lisp
lumm has joined #lisp
kristof has joined #lisp
kristof has quit [Ping timeout: 245 seconds]
lumm has quit [Ping timeout: 246 seconds]
noark9 has joined #lisp
<knobo>
The former is shorter if I only bind one value. And often more to the point.
hypnon has joined #lisp
frodef has quit [Ping timeout: 276 seconds]
xkapastel has joined #lisp
lumm has joined #lisp
frgo has joined #lisp
smokeink has quit [Remote host closed the connection]
frgo_ has quit [Read error: No route to host]
nirved has quit [Killed (kornbluth.freenode.net (Nickname regained by services))]
nirved has joined #lisp
nlyy has joined #lisp
nly has quit [Read error: Connection reset by peer]
smokeink has joined #lisp
kristof has joined #lisp
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
kristof has quit [Ping timeout: 250 seconds]
void_pointer has quit [Remote host closed the connection]
heisig has quit [Quit: Leaving]
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
Essadon has joined #lisp
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
kristof has joined #lisp
frgo has quit []
kristof has quit [Ping timeout: 252 seconds]
frgo has joined #lisp
<beach>
Xof: How many person-hours do you think have been spent to get SBCL to where it is now, including work on Spice Lisp and CMUCL? I am interested in comparing such a number to the number of hours of my remaining life expectancy. :)
frodef has joined #lisp
<phoe>
welp, found a bug in slime
<phoe>
typing "#2A((1 2 3)" and hitting Enter causes END-OF-FILE to be signaled
<beach>
They must not be using Eclector to parse the buffer. :)
<luis>
Most definitely not. :D
<Bike>
huh, wonder how that works though
<phoe>
or rather, "#2A("
<phoe>
that's enough to trigger the issue
<scymtym>
#P" is another one
<scymtym>
so any reader macro would be my guess
<phoe>
looks like it freaks on reader macros then
<phoe>
(other than #\( and #\" of course)
<beach>
#( works as well
<luis>
Have a look at slime-input-complete-p
<luis>
phoe: "(frob #2a((1 2 3) RET" works
heisig has joined #lisp
<Bike>
looks like it doesn't interact with the reader
<beach>
How so?
<Bike>
well i don't know all these emacs functions, but it looks like it's just looking for certain characters and doesn't call swank
<beach>
Hmm.
<beach>
That would be strange.
Zaab1t has joined #lisp
<Bike>
i guess to do it "right" you'd have to call read and get an eof value back
<luis>
It basically calls forward-sexp repeatedly to detect if there's an incomplete sexp. For some reason, it assumes the expression is complete if it doesn't match this regex: "\\s *['`#]?[(\"]".
<beach>
Oh, wow.
igemnace has joined #lisp
<luis>
It works fine 99.999% of the time. :-)
<luis>
[citation needed]
shka_ has quit [Remote host closed the connection]
shka_ has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
kristof has joined #lisp
sjotten has joined #lisp
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
kristof has quit [Ping timeout: 252 seconds]
shifty has quit [Ping timeout: 246 seconds]
aydio has joined #lisp
smokeink has quit [Remote host closed the connection]
pierpal has quit [Ping timeout: 244 seconds]
smokeink has joined #lisp
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
nlyy has quit [Quit: Quit]
nly has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 264 seconds]
warweasle has joined #lisp
<luis>
phoe: in slime-input-complete-p, try replacing the looking-at expression with t. I'll try and use it like that for a while as well. Let's see if we can find cases where it fails. (The most obvious one is that it'll treat "#", "#p", "#2a" as complete, but that doesn't seem too bad.)
hiroaki has quit [Ping timeout: 252 seconds]
lumm has quit [Read error: Connection reset by peer]
noark9 has quit [Quit: noark9]
jmercouris has joined #lisp
noark9 has joined #lisp
smokeink has quit [Remote host closed the connection]
kristof has joined #lisp
Lycurgus has joined #lisp
kristof has quit [Ping timeout: 250 seconds]
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
nly has quit [Quit: Quit]
nly has joined #lisp
<pjb>
beach: sbcl started from cmucl. You're starting from a clear sheet. You've got it easier!
<beach>
Sure. I just want an order of magnitude.
<p_l>
maybe possible to calculate from payroll of CMU for Spice Lisp and early CMU?
<beach>
Maybe so.
slyrus1 has joined #lisp
Roy_Fokker has joined #lisp
eskipode has joined #lisp
dddddd has joined #lisp
nokdoot has quit [Remote host closed the connection]
eskipode has left #lisp [#lisp]
nokdoott has joined #lisp
nowhereman_ has quit [Ping timeout: 250 seconds]
<phoe>
luis: OK - I'll try doing it that way.
dueyfinster has joined #lisp
astalla has joined #lisp
beach has quit [Disconnected by services]
beach has joined #lisp
Oladon has joined #lisp
heisig has quit [Quit: Leaving]
doubledup has joined #lisp
doubledup has quit [Remote host closed the connection]
anewuser has joined #lisp
kristof has joined #lisp
nowhereman_ has joined #lisp
kristof has quit [Ping timeout: 264 seconds]
lumm has joined #lisp
pierpal has joined #lisp
jmercouris has quit [Remote host closed the connection]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
elderK has quit [Quit: Connection closed for inactivity]
scymtym has quit [Ping timeout: 276 seconds]
pjb has quit [Ping timeout: 252 seconds]
Zaab1t has quit [Quit: bye bye friends]
pjb has joined #lisp
Kundry_Wag has joined #lisp
fsmunoz has joined #lisp
frodef has quit [Ping timeout: 240 seconds]
Kundry_Wag has quit [Remote host closed the connection]
scymtym has joined #lisp
nowhereman_ has quit [Ping timeout: 264 seconds]
Oladon has quit [Quit: Leaving.]
nly has quit [Read error: Connection reset by peer]
fsmunoz has quit [Remote host closed the connection]
nly has joined #lisp
oni-on-ion has quit [Read error: Connection reset by peer]
noark9 has quit [Quit: noark9]
younder has quit [Remote host closed the connection]
pierpal has quit [Ping timeout: 244 seconds]
solyd has joined #lisp
solyd has quit [Remote host closed the connection]
anewuser has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
slyrus1 has quit [Ping timeout: 246 seconds]
energizer_ is now known as energizer
hiroaki has joined #lisp
anewuser has joined #lisp
nokdoott has quit [Remote host closed the connection]
nokdoott has joined #lisp
nokdoott has quit [Max SendQ exceeded]
nokdoott has joined #lisp
nokdoott has quit [Remote host closed the connection]
nokdoott has joined #lisp
pierpal has quit [Ping timeout: 240 seconds]
nokdoott has quit [Remote host closed the connection]
ym has quit [Quit: Leaving]
robotoad has joined #lisp
aydio has quit [Quit: WeeChat 2.2]
aydio has joined #lisp
pierpal has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
Tordek has joined #lisp
space_otter has joined #lisp
aydio has quit [Ping timeout: 252 seconds]
aydio has joined #lisp
justanormalguy has joined #lisp
lumm has quit [Read error: Connection reset by peer]
astalla has quit [Ping timeout: 252 seconds]
cage_ has joined #lisp
nowhereman_ has joined #lisp
hiroaki has quit [Ping timeout: 250 seconds]
pierpal has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pjb has quit [Remote host closed the connection]
lumm has joined #lisp
pierpal has joined #lisp
dueyfinster has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
lumm has quit [Ping timeout: 252 seconds]
papachan has quit [Quit: WeeChat 2.2]
asymptotically has quit [Remote host closed the connection]
dueyfinster has joined #lisp
asymptotically has joined #lisp
comborico1611 has joined #lisp
nly has quit [Read error: Connection reset by peer]
pierpal has quit [Read error: Connection reset by peer]
nly has joined #lisp
nirved has quit [Quit: Leaving]
ggole has quit [Quit: ggole]
pierpal has joined #lisp
dented42 has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
detectiveaoi has joined #lisp
abbe has quit [Quit: “Everytime that we are together, it's always estatically palpitating!”]
abbe has joined #lisp
robotoad has quit [Ping timeout: 252 seconds]
comborico1611 has quit [Quit: Konversation terminated!]
frodef has joined #lisp
nowhereman_ has quit [Ping timeout: 264 seconds]
cage_ has quit [Quit: Leaving]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shka_ has quit [Read error: Connection reset by peer]
vlatkoB has quit [Remote host closed the connection]
astalla has joined #lisp
robotoad has joined #lisp
SenasOzys has joined #lisp
SenasOzys has quit [Client Quit]
Lycurgus has quit [Quit: Exeunt]
pjb has joined #lisp
zfree has joined #lisp
meepdeew has joined #lisp
justanormalguy has left #lisp [#lisp]
astalla has quit [Ping timeout: 264 seconds]
dueyfinster has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
igemnace has quit [Quit: WeeChat 2.3]
aydio has quit [Quit: WeeChat 2.2]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
razzy has quit [Ping timeout: 272 seconds]
fikka has joined #lisp
razzy has joined #lisp
hifitim has joined #lisp
comborico1611 has joined #lisp
<|3b|>
always nice when a backtrace isn't showing enough info because of optimized method dispatch, so M-. on method name, and C-u C-c C-c on the slime-xref buffer to recompile all the methods with high debug, then restart a frame in debugger and i have nice backtrace :)
<luis>
Cool.
<|3b|>
(not that i have any idea how to fix things, but at least a bit closer to knowing where to look)
Oladon has joined #lisp
kajo has joined #lisp
hifitim has quit [Ping timeout: 264 seconds]
hifitim has joined #lisp
mejja has joined #lisp
comborico1611 has quit [Quit: Konversation terminated!]
robotoad has quit [Quit: robotoad]
shka_ has joined #lisp
jmercouris has joined #lisp
hifitim has quit [Ping timeout: 276 seconds]
<Xach>
|3b|: hmm, can you C-u C-c C-c in the frame? does that just do one method?
<|3b|>
i think you can, but that would just do the one method
<|3b|>
(and need it to not have been TCOd away or whatever
<|3b|>
good for getting more locals in a particular frame though
<jcowan>
I think it would be a Good Thing if CL supported a full algebra of classes
<jcowan>
right now there are no classes of the type "As that are not Bs", for example
asymptotically has quit [Quit: Leaving]
<|3b|>
you can make a type for that
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
<|3b|>
would be hard to enumerate class precedence for methods if an object was a member of (not X) for (some large fraction of) all X
<|3b|>
which is why methods dispatch on classes instead of types
<|3b|>
but (typep 2 '(and number (not (integer 7 8)))) is fine (and true)
kajo has joined #lisp
random-nick has quit [Ping timeout: 240 seconds]
<|3b|>
or (typep 2 '(and integer (not (satisfies oddp)))) if you want full generality
oni-on-ion has joined #lisp
<phoe>
jcowan: huh?
<phoe>
(and a (not b))
<phoe>
that's a type specifier
<phoe>
oh, you want *classes* for that
<phoe>
it would require that your object is an instance of the class representing (and a (not b))
<phoe>
which would mean creating such a class everywhere you use that type specifier, and modifying the inheritance tree... nasty stuff I guess
<|3b|>
i guess you could have a not-x mixin?
<oni-on-ion>
types with type params a,b ? this some parametric typeclassing ?
<phoe>
|3b|: sure, but then you'll need a mapping from type (and a (not b)) to the not-x class
<phoe>
unless you go (and a not-b) which is weird
<phoe>
because suddenly (or b not-b) is not equal to T
<phoe>
;; (defvar *question* '(or b not-b))
<|3b|>
oni-on-ion: (deftype a-and-not-b (a b) `(and ,a (not ,b))) (typep 2 '(a-and-not-b number float)) -> t
razzy has quit [Read error: Connection reset by peer]
* oni-on-ion
parses+digests
<|3b|>
phoe: yeah, finite number of X that can be negated, and probably still doesn't make much sense :p
jmercouris has quit [Remote host closed the connection]
<jcowan>
Yes, the separation of classes and types is pretty artificial in a dynamically typed language.
<oni-on-ion>
'2' ??
<|3b|>
(typep 2 '(a-and-not-b number integer)) => nil
<oni-on-ion>
ohh didnt realise there was two forms there. getting over flu =)
rumbler31 has joined #lisp
<oni-on-ion>
coooool =)
dale has joined #lisp
<oni-on-ion>
CL types can basically do everything, not sure why it is not praised and/or applied practically a lot more often
* |3b|
uses types like (cons (eql foo)) to match '(foo ...)
<|3b|>
but gets a bit messy for anything much beyond that, better to use real pattern matching lib
<shka_>
oni-on-ion: culture
frodef has quit [Ping timeout: 252 seconds]
<shka_>
but yes, common lisp typedef is powerful
<shka_>
especially since you can construct type around predicate
<shka_>
with satisfy
moei has quit [Quit: Leaving...]
asarch has joined #lisp
<jcowan>
Short of that, however, you cannot type a homogeneous list, which strikes me as unfortunate.
<jcowan>
(typep '(1 2 3) '(list integer)) would be a Good Thing
<|3b|>
(typep '(1 2 3) '(satisfies alexandria:proper-list-p)) -> t
<|3b|>
ah, they already defined that, so (typep '(1 2 3) 'alexandria:proper-list) -> t
<|3b|>
possibly slightly faster even since they make sure it is a cons before calling proper-list-p
<|3b|>
and (typep '#1=(1 . #1#) 'alexandria:proper-list) -> NIL even
<|3b|>
and i can't read, missed the part about wanting typed lists :/
<jcowan>
But there is no way to pass the element type to a satisfies-function, so you would need one of these for each element type you are interested in: (satisfies list-of-integers), (satisfies list-of-symbols), etc.
<pillton>
What breaks if you relax this "Recursive expansion of the type specifier returned as the expansion must terminate, including the expansion of type specifiers which are nested within the expansion."?
<|3b|>
yeah, that's a bit harder
meepdeew has quit [Remote host closed the connection]
<jcowan>
pillton: That lets you give each type a name, but you still need both a deftype and a defun
<|3b|>
though you could still define a mapping of gensyms to per-type predicates
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
<jcowan>
Chicken's type syntax allows (list-of <type>) and (list <type> ...), where the latter specifies a fixed length but possibly heterogeneous list
<|3b|>
or manually define a predicate and type for each variant you care about
<|3b|>
but remember it is going to have to check every element every time it wants to check the type
<pillton>
jcowan: You could create an orthogonal list type that has that functionality.
<pillton>
jcowan: I have done that for arrays.
<|3b|>
at some point it becomes easier to just write your own predicate, or even oown list type
<jcowan>
It would be if you could add your own parameterized compound types
papachan has joined #lisp
<pillton>
You can.
<pillton>
It ain't pretty, but it is possible.
<jcowan>
What's the general mechanism? You could use macros if type expressions were really expressions, but they aren't.
shifty has joined #lisp
wintertot has joined #lisp
<fiddlerwoaroof>
|3b|: cool, learned a new thing
<fiddlerwoaroof>
I've been thinking I should build a "development" sbcl where I restrict-compiler-policy to debug 3
<jcowan>
pillton: You could have a function that rewrites extended type expressions as normal type expressions, but you would also need a replacement for subtypep
mejja has quit [Quit: mejja]
rumbler31 has quit [Remote host closed the connection]
buffergn0me has joined #lisp
rumbler31 has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
elderK has joined #lisp
lavaflow has quit [Read error: Connection reset by peer]