<aeth>
phoe: Thanks for your input earlier. I fixed the two issues you spotted and I'm going to think about how to approach the typecheck soon.
<aeth>
I'm not sure if I'll do that right away or if I'll do some graphics stuff first. I haven't done any graphics in a while and I'm thinking of some simple (3D, but effectively behaving the same as isometric) tiles.
dominic34 has joined #lisp
knuckles has quit [Ping timeout: 272 seconds]
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
dominic34 has quit [Ping timeout: 258 seconds]
userone has joined #lisp
wxie has joined #lisp
jeosol has quit [Ping timeout: 245 seconds]
orivej has quit [Read error: Connection reset by peer]
orivej has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
bitmapper has quit [Ping timeout: 246 seconds]
knuckles has joined #lisp
MidHotaru has joined #lisp
wxie has joined #lisp
orivej_ has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
gjulio_ has quit [Ping timeout: 272 seconds]
orivej_ has quit [Ping timeout: 256 seconds]
orivej has joined #lisp
jonatack has quit [Quit: jonatack]
gjulio_ has joined #lisp
jonatack has joined #lisp
JohnTalent has quit [Ping timeout: 256 seconds]
gjulio_ has quit [Ping timeout: 264 seconds]
userone has quit [Quit: Leaving]
gjulio_ has joined #lisp
orivej has quit [Ping timeout: 258 seconds]
EvW has joined #lisp
ldb has joined #lisp
<ldb>
helo
GuerrillaMonkey has joined #lisp
kleptoflora has joined #lisp
knuckles has quit [Ping timeout: 256 seconds]
Jeanne-Kamikaze has quit [Ping timeout: 246 seconds]
philadendrite has quit [Ping timeout: 264 seconds]
ldb has quit [Quit: leaving]
TwoNotes has joined #lisp
Oladon has quit [Quit: Leaving.]
akoana has left #lisp ["Leaving"]
nicktick has joined #lisp
TwoNotes has quit [Quit: Leaving]
Oladon has joined #lisp
nicktick has quit [Ping timeout: 256 seconds]
freshpassport has joined #lisp
v88m has joined #lisp
<beach>
Good morning everyone!
EvW has quit [Ping timeout: 260 seconds]
jesse1010 has quit [Ping timeout: 240 seconds]
shangul has joined #lisp
MidHotaru has quit [Quit: Connection closed for inactivity]
madrik has quit [Remote host closed the connection]
vaporatorius__ has quit [Ping timeout: 246 seconds]
pve has joined #lisp
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #lisp
stoneglass has joined #lisp
matzy_ has joined #lisp
joels has joined #lisp
<matzy_>
can you connect mito to a remote database, like one on RDS? I tried passing :host and :port to mito:connect-toplevel but I think that's where my error is coming from
<joels>
Hello all
nikkal has joined #lisp
dddddd has joined #lisp
orivej_ has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
<beach>
Hello joels.
<matzy_>
nvm i'm stupid
vms14 has joined #lisp
Harag has joined #lisp
<vms14>
how can I implement the qw function of perl in lisp?
<Harag>
I am working my way through left over lambda, tyring the code of
<Harag>
(defmacro/g! nif ...) I get undefined variable g!result. Is there
<Harag>
something wrong with the code of defmacro/g! in then online version of
<Harag>
the book or am I doing something wrong?
ljavorsk has joined #lisp
tich has joined #lisp
<vms14>
I want something like (qw there are strings there)
<Harag>
eish sorry about that broken post
<beach>
vms14: It is much better if you tell people what you want it to do, rather than assuming people know Perl.
<vms14>
and being converted to ("there" "are" "strings" "there")
<vms14>
beach: I was doing that
<beach>
vms14: Well, first of all, qw can't be written as a function.
<vms14>
the thing is, if I make a macro, and convert symbols to strings, the print case won't let me have mixed case,not?
<beach>
Because functions evaluate their arguments, and you apparently don't want that.
rogersm has quit [Read error: Connection reset by peer]
<vms14>
I only see in *print-case* :downcase :capitalize and :upcase
<beach>
Well, if you use default reader settings, then it is already too late by the time the symbol is being read.
<vms14>
then it has to be a reader macro?
<vms14>
seems the way, thanks
<beach>
It is going to be hard to keep that syntax in a reader macro.
<vms14>
then what I should aim at?
<beach>
In my opinion, you should forget about imitating the surface syntax of a language with a surface syntax that is as different from that of Common Lisp as this one seems to be.
<beach>
Or else, if Perl syntax is what you want, then don't use READ.
<beach>
Write a parser for Perl instead.
<vms14>
I just want a function/macro that turns symbols to strings
<beach>
Oh, that one is easy.
<vms14>
but, without touching the case
<beach>
That one is easy too.
<jackdaniel>
how about (string 'foo) ;?
<beach>
vms14: symbol-name does not touch the case.
<vms14>
oh, thanks
<beach>
vms14: Try (symbol-name '|aBcD|) for instance.
<vms14>
but they'll have to be between || ?
<phoe>
yes
<phoe>
it's the reader itself that upcases or downcases symbols
<phoe>
so you'll need a reader macro for that
<vms14>
thanks phoe
<vms14>
I'll try with a reader macro then
<beach>
phoe: But then vms14 can't easily write (qw ....).
<vms14>
also an excuse to learn
<flip214_>
vms14: It might look like #q(...)
<vms14>
but the reason is to not type "" for every string
<phoe>
beach: it's impossible to write that either way without a custom reader
<vms14>
if I have to use || it's almost the same
<phoe>
by the time macroexpansion happens all the symbols are already upcased
<beach>
vms14: I think it is a really bad idea to do what you seem to want.
<phoe>
vms14: if you need to use a reader macro it'll look like #{Hello world}
<phoe>
which is also almost the same
<phoe>
(mostly because || and "" are reader macros under the hood, too)
heisig has joined #lisp
<vms14>
didn't know "" was a reader macro
ebrasca has quit [Remote host closed the connection]
<phoe>
it's really turtles all the way down, until you hit the GC
<vms14>
the quotation mark, yes, just syntax sugar for (quote)
<flip214_>
vms14: when I came over from Perl, I tried to make CL more similar to Perl, too.
<vms14>
flip214_: and what did you achieve?
<phoe>
vms14: parentheses are just syntax sugar for READ-DELIMITED-LIST
<flip214_>
After some more practice I found out that most of that stuff isn't necessary ... CL-PPCRE:SCAN is a bit longer than /../, but it gives more results back anyway
<flip214_>
so I got around to like the verbose Lisp way -- it's more readable over the long run anyway
<vms14>
I'm actually mixing perl and lisp by using sockets and perl eval XD
<vms14>
in netbsd I have some troubles, like no threads in sbcl, and most of libraries won't work
<vms14>
so perl will be the lisp libraries
<vms14>
actually using sdl from perl, and wanting to do the logic in lisp
<flip214_>
why not embrace lisp symbols, and just serialize them as strings to perl?
karlosz has quit [Quit: karlosz]
<flip214_>
I did a reader macro that kept case for me; then I could write §MixedCase-Symbol or §(Mixed List)
<flip214_>
I needed that for JSON serialization (right case for keys)
<vms14>
just wanted to have the qw function in lisp
<phoe>
can't do that without a reader macro
<vms14>
yeah, I'll try
<vms14>
thanks phoe
<phoe>
I assume you could do stuff like #{foo bar baz QuUx} that evaluates to ("foo" "bar" "baz" "QuUx")
<vms14>
that's what I want
<phoe>
totally doable with a reader macro then
anatrope has joined #lisp
<beach>
vms14: According to what you said, that is NOT what you want. You said you wanted to be able to write (qw ...).
<vms14>
yes, but the only way seems to be a reader macro
<vms14>
so qw{} it's kinda fine
kleptoflora has quit [Ping timeout: 272 seconds]
<vms14>
or alike
<vms14>
and even more alike to perl
<beach>
vms14: It is mystery to me why that particular reader macro is acceptable, but (qw ".." "...") is not.
<vms14>
cause the reason is I'm lazy to put ""
<vms14>
xd
<vms14>
and it's a nice excuse to learn how to make a reader macro, which always wanted to do
<beach>
Good luck!
<vms14>
thanks :D
JohnMS_WORK has quit [Read error: Connection reset by peer]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
matzy_ has quit [Remote host closed the connection]
<phoe>
vms14: yes
<phoe>
mostly because READ will attempt to read symbols
<phoe>
and that will badly break
<phoe>
inside a loop with WITH-OUTPUT-TO-STRING, read-chars until you read whitespace
<phoe>
collect the list of strings until you hit #\}
<phoe>
at which point, return it
<phoe>
it's literally a function that works on a Lisp stream and pops chars from it
Cymew has joined #lisp
cosimone has joined #lisp
contrapunctus has left #lisp [#lisp]
wxie has joined #lisp
jesse1010 has joined #lisp
freshpassport has joined #lisp
<vms14>
I'll try later
<vms14>
see you guys, and thanks for the help
vms14 has quit [Remote host closed the connection]
wxie has quit [Ping timeout: 246 seconds]
wxie has joined #lisp
rogersm has quit [Quit: Leaving...]
scymtym has quit [Ping timeout: 264 seconds]
cosimone has quit [Quit: Quit.]
fbmnds has joined #lisp
cosimone has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
<fbmnds>
I was advised to repeat my 'post' from Saturday on a working day
<fbmnds>
hence: I'd like to know whether there is interest in this community to dig into EQL5 in essence to be able to further maintain this project. From what I understood going through the code base, EQL5 is based on witty design ideas and allows for cross platform GUI development (the examples apps work nice on my Android mobile, too - iOS is also
<fbmnds>
supported).
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life_ is now known as Lord_of_Life
bhartrihari has joined #lisp
<phoe>
fbmnds: I'd certainly be interested if it becomes cross-implementation in result
<flip214_>
minion: memo for vms14: If you have your own reader macro, you could also make #\: a constituent character within this list... then you could (READ-DELIMITED-LIST) in your own *PACKAGE* and get symbols like |This::Form|
<minion>
Remembered. I'll tell vms14 when he/she/it next speaks.
<phoe>
flip214_: is that portable?
wxie has quit [Ping timeout: 240 seconds]
<flip214_>
phoe: I guess that within your own readtable a COPY-SYNTAX from #\x to #\: should be conforming?!
<phoe>
that's a more general question I guess - if a package patches some other code by including and evaluating modified snippets of its source, does the copyleft virality also apply?
<phoe>
boy, things are interesting in the Lisp world
<rgherdt>
phoe: I would say yes, that doesn't seem to be different than other languages
<beach>
Another thing that other languages apparently have been stealing from us.
freshpassport has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cosimone has quit [Quit: Quit.]
cosimone has joined #lisp
bitmapper has joined #lisp
<phoe>
32 bits of data leaves plenty of space for tagging information on 64-bit implementations, whereas with fullword data like doubles the compiler and programmer need to exercise and cooperate a lot to prevent boxing
<phoe>
...or with single floats on 32-bit implementations
fanta1 has joined #lisp
akrl`` has quit [Read error: Connection reset by peer]
efm has joined #lisp
bsd4me has joined #lisp
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
bitmapper has quit [Read error: Connection reset by peer]
Trpger has joined #lisp
bitmapper has joined #lisp
Trpger has quit [Remote host closed the connection]
wsinatra has joined #lisp
<p_l>
I wonder if it would be possible (or sensible at all) to somehow pack pointers into NaNs on a CL implementation
<phoe>
p_l: hmmm, you'd get 53 bits of address space that way
<phoe>
54 if you count the sign bit
<phoe>
uh, I mean 52/53
joels has quit [Ping timeout: 264 seconds]
<p_l>
phoe: more interested in how effective one can use them as pointers, unboxed
fanta1 has quit [Ping timeout: 244 seconds]
lavaflow has joined #lisp
fanta1 has joined #lisp
DGASAU has quit [Read error: Connection reset by peer]
DGASAU has joined #lisp
rgherdt has quit [Quit: Leaving]
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 256 seconds]
X-Scale` is now known as X-Scale
dominic34 has joined #lisp
rgherdt has joined #lisp
<ggole>
NaN-boxing is probably better for languages with double-only numbers
fluxwave has quit [Read error: Connection reset by peer]
stux|RC has quit [Quit: Aloha!]
fluxwave has joined #lisp
fluxwave has quit [Read error: Connection reset by peer]
stux|RC has joined #lisp
OpenZen has joined #lisp
pve has quit [Ping timeout: 256 seconds]
fluxwave has joined #lisp
fluxwave has quit [Read error: Connection reset by peer]
jw4 has quit [Read error: Connection reset by peer]
jw4 has joined #lisp
rgherdt has quit [Quit: Leaving]
rgherdt has joined #lisp
fluxwave has joined #lisp
fluxwave has quit [Read error: Connection reset by peer]
korner has joined #lisp
sjl has joined #lisp
fluxwave has joined #lisp
pve has joined #lisp
fluxwave has quit [Read error: Connection reset by peer]
<jmercouris>
is there something like collect-if in a loop macro?
<beach>
when ... collect ...
<phoe>
jmercouris: (loop ... when x collect y ...)
<jmercouris>
ah, yes
<jmercouris>
thank you
fluxwave has joined #lisp
bhartrihari has joined #lisp
toorevitimirp has joined #lisp
akrl`` has joined #lisp
rogersm has quit [Quit: Leaving...]
bhartrihari has left #lisp ["Disconnected: closed"]
pve has quit [Ping timeout: 256 seconds]
tich has quit [Remote host closed the connection]
rumbler31_ has joined #lisp
rippa has joined #lisp
<korner>
so i had been bit confused, i was told to test lisp code i should use sbcl but i cannot quite find how to actually use it
<phoe>
korner: `sudo apt install sbcl && sbcl`?
<phoe>
that's the installation and running part that should get you all the way to the SBCL prompt
gjulio_ has joined #lisp
<korner>
i have sbcl but i couldnt quite figure out how to "run" .lisp file
<phoe>
sbcl --load foo.lisp
<phoe>
and/or sbcl --script foo.lisp
pve has joined #lisp
<korner>
thanks that works
<phoe>
the former will AFAIK load it and stay alive, the latter will load the file and exit
orivej has joined #lisp
<beach>
korner: You don't typically use Common Lisp the way you use (say) C. It is more common to start a REPL (Read-Eval-Print-Loop) and work from inside the system.
<korner>
i never touched C before
<beach>
Well, any batch language.
<beach>
korner: If you plan to develop in Common Lisp the way you do in a typical batch language, you probably won't see the point.
<phoe>
maybe another question
<phoe>
korner: what's your use case?
<korner>
not sure what batch language is but i was just curious bout lisp thats all
<korner>
not work, not student, just simply curiosity cause the syntax seems pretty nice
<phoe>
oh
<beach>
korner: By a batch language, I mean one that takes a source file, turn it into an executable, which you then start from your shell prompt.
<korner>
ah i see
<korner>
yeah i tried rust and haskell, that was some black magick
<phoe>
Lisp is another kind of black magic
<phoe>
you program in Rust and Haskell by writing code that the compiler then turns into executables
<korner>
yes
<phoe>
but you program in Lisp by starting a Lisp image and then modifying it until it contains the program that you want
<korner>
i noticed though that lisp syntax is lil bit simmiliar to the way i format lua so thats fun
EvW1 has quit [Ping timeout: 244 seconds]
<phoe>
it's a different creative process
<korner>
but i think i get the idea
<phoe>
mostly because Lisp stays alive throughout the whole programming experience
<beach>
korner: I think there are some YouTube videos that will give you the idea about how we work.
<korner>
was quite confused what i am even supposed to learn cause there is some common lisp, racket and million other lisps, thought common lisp would be nice starting point
<korner>
was told that common-lisp is useless but that sounds unlikely
<phoe>
korner: #lisp is a Common Lisp place, so obviously we'll suggest Common Lisp to you
<phoe>
it's a general-purpose programming language that I personally use for all personal projects I make
random-nick has quit [Quit: quit]
<phoe>
I really enjoy its interactivity and really short feedback loops.
gjulio_ has quit [Ping timeout: 240 seconds]
akrl`` has quit [Read error: Connection reset by peer]
orivej has quit [Ping timeout: 256 seconds]
rumbler31_ has quit [Ping timeout: 272 seconds]
random-nick has joined #lisp
orivej has joined #lisp
pve has quit [Ping timeout: 256 seconds]
korner has quit [Quit: Lost terminal]
Cymew has quit [Ping timeout: 256 seconds]
<contrapunctus>
I was wondering today...could I use CL to make a MIDI sequencer? 🤔 It seems to be the exclusive domain of C/C++
<beach>
Of course you can.
<contrapunctus>
And GC won't pose an issue? o.o
<beach>
That would depend on the Common Lisp implementation.
<beach>
It would also depend on how low-level you want things to be in your application.
<beach>
Like, do you want to generate the sound yourself from oscillators and/or sample files?
<contrapunctus>
The latter, at least
<beach>
Also, it will depend on how "real-time" you need for it to be. If you fill the sound buffers enough, a GC won't ruin it.
<beach>
But it is probably best to avoid too much allocation during the "rendering" phase.
<beach>
The thing is, most current FLOSS Common Lisp implementations have a GC that is not very good for real-time.
<contrapunctus>
oh ._.
<beach>
I think you can avoid allocation entirely during rendering.
<beach>
After all, it is just arithmetic.
<beach>
Or, you can run some test code to see how long a GC typically takes.
<phoe>
another possibility is linking against FFI sound generators that don't suffer from GC issues - e.g. cl-collider for SuperCollider
<phoe>
that's mostly because we don't have soft-real-time GCs in free Common Lisp implementations
<phoe>
otherwise one could just write one in CL
<beach>
But we are working on such an implementation.
<phoe>
^
<phoe>
I do want to see a soft-real-time GC in action in Common Lisp
<beach>
So I say, write the thing in Common Lisp entirely. See how it works out. Maybe tweak the parameters for current Common Lisp implementations.
<beach>
Then, once we have a good GC, use it.
<phoe>
hah, optimizing for the optimistic future
<phoe>
I can't blame you :D
<beach>
My experience is that it takes some time to write significant applications, and then the context has evolved.
Jesin has quit [Ping timeout: 260 seconds]
knuckles has quit [Ping timeout: 246 seconds]
matzy_ has joined #lisp
choegusung has joined #lisp
<shangul>
Finally, I translated "How to make Lisp go faster than C" to my native language.
<rgherdt>
beach: which implementation do you mean? (that's working on real-time GC)
<beach>
minion: Please tell rgherdt about SICL.
<minion>
rgherdt: SICL: SICL is a (perhaps futile) attempt to re-implement Common Lisp from scratch, hopefully using improved programming and bootstrapping techniques. See https://github.com/robert-strandh/SICL
<beach>
Oh, and we are well on the say, so I don't think it is futile. :)
<phoe>
it already had multiple nice effects on the ecosystem even though it's incomplete, so definitely not futile
<beach>
Fair enough.
orivej has quit [Ping timeout: 264 seconds]
<phoe>
Eclector and Cleavir are the two most notable ones that I can think of
<phoe>
might be even more that I haven't yet become aware of
<beach>
Trucler too, but less spectacular.
<beach>
Compile-time lexical environments.
* phoe
reads up on trucler
<beach>
It is basically a CLOS-y version of the environment stuff from CLtL2.
<rgherdt>
beach: thanks, will read about it
<beach>
Also much more complete.
<beach>
rgherdt: There is a specification. Hold on, I'll give you a link to a PDF.
DGASAU has quit [Remote host closed the connection]
ebrasca has quit [Remote host closed the connection]
DGASAU has joined #lisp
efm has quit [Ping timeout: 258 seconds]
choegusung has quit [Quit: leaving]
nikkal has joined #lisp
<matzy_>
should i be overly concerned if i created a db table in mito using it's classes and i see the table in my sql editor, but the (mito:ensure-table-exists 'mytable) returns NIL?
nydel has joined #lisp
JohnTalent has joined #lisp
EvW has joined #lisp
fanta1 has quit [Quit: fanta1]
knuckles has joined #lisp
<mfiano>
M-. and you'll see it returns the result of MAPC
matzy_ has quit [Remote host closed the connection]
bhartrihari has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
aindilis has quit [Read error: Connection reset by peer]
zigpaw has quit [Ping timeout: 272 seconds]
zigpaw has joined #lisp
matzy_ has joined #lisp
aindilis has joined #lisp
karlosz has joined #lisp
Necktwi has quit [Quit: leaving]
lonjil has quit [Quit: No Ping reply in 210 seconds.]
bhartrihari has joined #lisp
bsd4me has quit [Remote host closed the connection]
jbgg has quit [Remote host closed the connection]
lonjil has joined #lisp
Necktwi has joined #lisp
stoneglass has left #lisp ["ERC (IRC client for Emacs 26.3)"]
jbgg has joined #lisp
fluxwave has quit [Read error: Connection reset by peer]
fluxwave has joined #lisp
fluxwave has quit [Read error: Connection reset by peer]
fluxwave has joined #lisp
ebrasca has joined #lisp
rogersm has joined #lisp
v88m has joined #lisp
matzy_ has quit [Remote host closed the connection]
shangul has quit [Ping timeout: 256 seconds]
akrl`` has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
fluxwave has quit [Quit: leaving]
akrl`` has quit [Read error: Connection reset by peer]
akrl`` has joined #lisp
toorevitimirp has quit [Ping timeout: 240 seconds]
<Bike>
not that i know of. let me see if i can write one real quick
<alandipert>
oh jeez, disregard, it's there at the bottom :-)
<Bike>
oh, is it?
<Bike>
ah, yeah.
<alandipert>
yeah i gave it a go myself and looks like i arrived at something not far off from his
<alandipert>
phew
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
aindilis has quit [Read error: Connection reset by peer]
<Bike>
this is kind of confusing to follow.
Jesin has joined #lisp
<Bike>
but yeah having a thread local global vector is basically it
heisig has quit [Quit: Leaving]
matzy_ has joined #lisp
cosimone has quit [Read error: Connection reset by peer]
cosimone has joined #lisp
shangul has joined #lisp
akrl`` has quit [Remote host closed the connection]
terpri_ has joined #lisp
akrl`` has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
terpri has quit [Ping timeout: 260 seconds]
aindilis has joined #lisp
aindilis has quit [Read error: Connection reset by peer]
stepnem_ has quit [Ping timeout: 264 seconds]
stepnem has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
nikkal has quit [Ping timeout: 256 seconds]
<matzy_>
what's the point of setting an accessor that's different that the slot name?
<phoe>
matzy_: you don't export slot names this way
<phoe>
(defclass foo ((%bar :accessor bar))) <- I only export FOO and BAR
<phoe>
this prevents people from using SLOT-VALUE and forces them to uses the accessor functions, which may implement additional logic.
<phoe>
where "prevents" means "unless they want to type the unholy trio of characters, «::%»"
<matzy_>
so you can make your :accessor a function?
<phoe>
what do you mean, make it a function?
<phoe>
:accessor defines a pair of functions, #'BAR and #'(SETF BAR)
Sauvin has quit [Read error: Connection reset by peer]
<matzy_>
right, but you mentioned additional logic implemented by the accessor
brown121407 has joined #lisp
<matzy_>
oh, you mean when you set the accessor you can implement additional logic
<phoe>
(defmethod bar :around (object) ...)
<phoe>
(defmethod bar :after (object) ...)
<phoe>
(defmethod bar :before (object) ...)
efm has joined #lisp
<phoe>
then also the variants of the above that specialize on OBJECT in various ways
akrl`` has quit [Ping timeout: 256 seconds]
<matzy_>
ok, that helps. thanks a lot
bhartrihari has joined #lisp
<matzy_>
so best practice is to always give your accessors a different name
<matzy_>
or a similar but slightly different name
<phoe>
the common thing is to name slots %foo and accessors foo
<phoe>
where "%" means "internal"
ech has quit [Remote host closed the connection]
efm has quit [Ping timeout: 246 seconds]
<_death>
I don't think it's particularly common..
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
pve has joined #lisp
mankaev has quit []
<phoe>
s/the common thing/the naming scheme I personally use/
aindilis has joined #lisp
arbv has quit [Read error: Connection reset by peer]
efm has joined #lisp
<Bike>
beach does it too, so that makes it basically a standard,
arbv has joined #lisp
<phoe>
you mean a new standard, newer than ANSI CL?
<phoe>
oh boy here comes that discussion again~
<_death>
personally I dislike adorning symbols with strange characters beyond the earmuff convention
shangul has quit [Ping timeout: 264 seconds]
nikkal has joined #lisp
efm_ has joined #lisp
efm has quit [Ping timeout: 265 seconds]
<phoe>
how do you solve the export-the-accessor-not-the-slot-name problem then?
<_death>
btw thanks phoe and beach for today's online meeting.. I got into it a bit late and didn't bother logging in
<phoe>
_death: the video is online
<phoe>
both on Twitch (still) and on YouTube
<_death>
phoe: in my experience it's a nonissue
<phoe>
_death: that's a valid answer too
<phoe>
but anyway if you'd like to talk about anything for the next meeting, feel free to let me know
akrl`` has joined #lisp
<phoe>
and by "you" I mean "hey #lisp come on the slot's free let's keep the meetings rolling and such"
<_death>
also, I sometimes (often?) use the convention of giving a protocol-specific prefix to the access functions
aamukastemato has joined #lisp
terpri__ has joined #lisp
mankaev has joined #lisp
mankaev has quit [Client Quit]
efm_ has quit [Quit: Konversation terminated!]
terpri_ has quit [Ping timeout: 260 seconds]
<pve>
Sometimes, I dream of a library that aggregates all the common defclass usage patterns into a set of convenience macros that I could choose from, depending on my mood.
<pve>
Or one that provides a define-class-construction-kit, to which you can say "Hey, gimme a define-class macro with so-and-so slot and accessor naming scheme that maybe exports the class and its accessors by default, so my fingers don't bleed everytime I want to define a class".
dominic34 has quit [Ping timeout: 264 seconds]
_paul0 has joined #lisp
v88m has quit [Read error: Connection reset by peer]
aamukastemato has quit [Quit: Leaving]
paul0 has quit [Ping timeout: 246 seconds]
Lycurgus has joined #lisp
rogersm has quit [Quit: Leaving...]
akrl`` has quit [Ping timeout: 260 seconds]
edgar-rft has quit [Quit: Leaving]
JohnTalent has quit [Quit: leaving]
nicktick has joined #lisp
akrl`` has joined #lisp
brown121407 has quit [Remote host closed the connection]
arbv has quit [Read error: Connection reset by peer]
arbv has joined #lisp
shka_ has quit [Ping timeout: 256 seconds]
hiroaki has joined #lisp
brown121407 has joined #lisp
simendsjo has joined #lisp
Inline has joined #lisp
dominic34 has joined #lisp
scymtym has quit [Ping timeout: 244 seconds]
dominic34 has quit [Client Quit]
<ym>
Is a task of implementing arrays with signed (possible negative, in similar way C pointers allows it) index out of standard? Maybe someone knows an example?
<phoe>
not in portable CL
<phoe>
array indices are from 0 upwards
gaqwas has joined #lisp
gaqwas has joined #lisp
<phoe>
why though?
orivej has joined #lisp
matzy_ has quit [Read error: Connection reset by peer]
<ym>
Why? I have a sine LUT and it would be nice to have positive values for 0 to pi and negative for 0 to -pi.
<Bike>
you can just have a function that accesses the lut and takes a possibly negative index as argument, and then it gets the actual index with a subtraction.
<ym>
Yes, but it costs.
<phoe>
use (mod n 2pi)
<ym>
I do.
<Bike>
barely anything. also, you could just have a table from 0 to pi and negate it, couldn't you?
<phoe>
don't know if it can be done any better in portable CL then
<_death>
a lookup table is suspicious in the first place
<Bike>
a C array is just a bunch of objects that are contiguous in storage. a lisp array is an actual structure. so lisp arrays don't work like C arrays.
<ym>
Bike, I can, but I also has a compound type that will fit very well with described LUT access method. But thanks anyway.
<ym>
_death, why?
<_death>
because nowadays on much hardware sine computation would be much faster than a memory access
<ym>
How do you write lisp code with modern hardware?
duuqnd has quit [Remote host closed the connection]
duuqnd has joined #lisp
ayuce has quit [Remote host closed the connection]
nicktick has quit [Quit: Leaving.]
narimiran has quit [Quit: leaving]
<ym>
fsin always takes hundreds cycles. Maybe if you implement your own sine on modern Intel's CPU+FPGA chips, that would be same as accessing precalculated value.
ggole has quit [Quit: Leaving]
EvW has quit [Ping timeout: 244 seconds]
bsd4me has joined #lisp
nicktick has joined #lisp
elderK has joined #lisp
<elderK>
Hey all, I was wondering if anyone had any experience with ASDF package-inferred-systems. If so, how did you feel about them? Did you find they made it easier to manage larger projects? Any alternatives?
cosimone has joined #lisp
nicktick has quit [Client Quit]
EvW has joined #lisp
brown121407 has quit [Remote host closed the connection]
gxt has quit [Ping timeout: 240 seconds]
nicktick has joined #lisp
gxt has joined #lisp
knuckles has quit [Ping timeout: 272 seconds]
knuckles has joined #lisp
pfdietz has joined #lisp
gravicappa has quit [Ping timeout: 272 seconds]
cranes has quit [Quit: Lost terminal]
Oladon has joined #lisp
<pve>
elderK: it's a matter of taste, if you're comfortable with juggling exports then it's fine
cosimone has quit [Ping timeout: 260 seconds]
<pve>
in my current project I do one package per directory/module
sz0 has quit [Quit: Connection closed for inactivity]
<Lycurgus>
if it only came in 3.1.2 ... .
<phoe>
How can I define a LIST-OF type using SATISFIES that will only match lists whose all elements are of type TYPE? I want to use it like (typep x '(list-of number))
<phoe>
I assume that this should expand into (satisfies somepred) - but, given a single argument to the type expander, what should SOMEPRED be?
<phoe>
do I need to DEFUN inside the type expander to take care of that?
gaqwas has quit [Ping timeout: 256 seconds]
sz0 has joined #lisp
<ym>
deftype has example in hyperspec. somepred would be a list you're checking.
userone has joined #lisp
<phoe>
a list? what do you mean?
<phoe>
SOMEPRED must be a one-argument predicate if it's a part of SATISFIES
<pve>
I remember trying to do that a long time ago too, my conclusion (could be wrong) was that you needed to have some magic to ensure predicates exist for each concrete type you want to check
<phoe>
also, the example isn't really what I am looking for
<elderK>
pve: How do you handle the case where two modules require something from each other? Say, interfaces.
<elderK>
Just define an interfaces package?
<elderK>
I've been playing with Lisp for awhile now but I'm still new to using it in a practical sense :)
<phoe>
elderK: the easiest is to define a protocol/interface package and have the modules use it
<ym>
phoe, you first defun somepred so that it accept one argument, then you deftype with (satisfies somepred). Why don't you like the example?
<pve>
elderK: hmm I try to make sure the dependencies are one-way always
<pve>
if that's what you mean
<elderK>
phoe: Another question is, like, constructors. How do you handle the case of initializing stuff in a new object instance? Say, some members are initialized in a complex way, based on some parameters you set when you create the instance. Do you just have a function that encapsulates that all? Do you use shared-initialize? I'm not sure what the best way is to handle that.
* Lycurgus
forgot the geneology back to mk-defsystem. Also thereis a grovel extension.
<phoe>
ym: I cannot define a single type named LIST-OF that accepts a type as an argument. I must define LIST-OF-NUMBER, LIST-OF-INTEGER, LIST-OF-SYMBOL, ...
<elderK>
That is, creating an instance is more complex than just (make-instance 'thing ...)
<phoe>
elderK: wait a second, what do you mean, more complex
<phoe>
MAKE-INSTANCE is supposed to be the external interface, because you can arbitrarily complicate the process of instantiating
<phoe>
by defining methods on INITIALIZE-INSTANCE, REINITIALIZE-INSTANCE, SHARED-INITIALIZE, and/or the two update functions
<phoe>
in a purely CLOSsy perspective, you should never need any kind of wrapper over MAKE-INSTANCE
<elderK>
phoe: Okay, so methods on those generics are roughly equivalent to constructors in other languages?
<phoe>
elderK: yes, that's the idea.
<elderK>
phoe: Thank you :)
<phoe>
INITIALIZE-INSTANCE: for new instances. REINITIALIZE-INSTANCE: for old instances that you need to "reinitialize", whatever it means for you.
<phoe>
Update methods: when the class was modified or you change the instance's class.
<elderK>
How often should we be concerned with reinitialize-instance and such? I rarely see them defined.
<phoe>
SHARED-INITIALIZE: for code that is supposed to execute in all of the above cases.
<phoe>
elderK: do you call REINITIALIZE-INSTANCE on your instances?
<ym>
phoe, maybe store list type in the end of the list?
<phoe>
if you don't have a use case for it and don't call it, then you can use the default behavior
<phoe>
ym: sounds dirty.
<phoe>
then the list contains objects that aren't of the type I want
<phoe>
we could cons them onto the beginning of that list I guess, but then suddenly we get (typep (cons type list) '(satisfies list-of-x))
<phoe>
I'll go the SETF FDEFINITION way
<ym>
Don't list always has nil in the end?
<phoe>
consing onto the beginning is cheaper than consing at the end and doesn't require the list to be mutated
<phoe>
if I have a list (1 2 3), I don't want to traverse it and set its last CDR to some type so I get (1 2 3 . MY-AWESOME-TYPE)
<phoe>
since not only that destroys my list, it's also really really pointless
<ym>
Maybe check the type of first element of a list in somepred and compare it's type to other elements type.
<elderK>
phoe: If I have a class B and I want to create an instance of it in file A (but not use any of its methods), is it wise to have A depend on the file that defines B?
<ym>
It will only tell if list is filled with similar type elements though.
<elderK>
Or is it not necessary in CL? Since, make-instance just accepts a symbol for the class name?
<phoe>
elderK: it accepts a symbol just fine
<elderK>
I've been going on the hypothesis that the symbol naming the class is namespaced, and so I could import it.
<elderK>
Say, foo:my-class vs zug:my-class.
<phoe>
sure, as long as the symbol already exists
<phoe>
...at read-time, I mean
Inline has quit [Ping timeout: 246 seconds]
<elderK>
phoe: If initialize-instance takes care of initializing some slots, how do you ensure that another user instantiating your class, doesn't specify initializers for those slots directly?
<Xach>
don't make the initarg easy to use
<elderK>
If class A has slots s0 and s1, and s1 is initialized in initialize-instance, how do I prevent the user (make-instance 'A :s1 whatever)
<Xach>
use a "private" symbol as the initarg for s1, for example
<Xach>
or don't have an initarg for it at all
cranes has joined #lisp
cranes has quit [Client Quit]
<Xach>
or document that they Mustn't
<elderK>
Thank you, Xach.
<elderK>
I've been using keyword symbols for initargs. I didn't think to use an ordinary symbol :)
cranes has joined #lisp
gaqwas has joined #lisp
gaqwas has joined #lisp
gaqwas has quit [Changing host]
<Xach>
elderK: it is not very common in my experience
<Xach>
but, this is a situation that calls for them