phoe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.16, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
ym555 has joined #lisp
pillton has joined #lisp
Kundry_Wag has joined #lisp
nckx has quit [Quit: Updating my GNU Guix System <https://guix.info>]
nckx has joined #lisp
shangul has quit [Ping timeout: 268 seconds]
Kundry_Wag has quit [Ping timeout: 248 seconds]
_leb has joined #lisp
ym555 has quit [Ping timeout: 248 seconds]
nisstyre has quit [Changing host]
nisstyre has joined #lisp
ym555 has joined #lisp
caltelt_ has joined #lisp
john2x has quit [Ping timeout: 248 seconds]
_leb has quit []
Kundry_Wag has joined #lisp
rdh has joined #lisp
Kundry_Wag has quit [Ping timeout: 272 seconds]
rdh has quit [Remote host closed the connection]
libertyprime has quit [Quit: leaving]
_leb has joined #lisp
nicklaf has quit [Ping timeout: 248 seconds]
john2x has joined #lisp
keep_learning_M has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 272 seconds]
<loke> Finally
<loke> trivial-left-pad is a new QL library.
shangul has joined #lisp
Oladon has joined #lisp
zotan has quit [Ping timeout: 257 seconds]
zotan has joined #lisp
pillton has quit [Read error: Connection reset by peer]
shangul has quit [Quit: sudo rm -rf /usr/*]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 248 seconds]
ym555_ has joined #lisp
orivej has quit [Ping timeout: 258 seconds]
ym555 has quit [Ping timeout: 244 seconds]
v0|d has joined #lisp
cropcircle has joined #lisp
john2x has quit [Ping timeout: 248 seconds]
makomo has quit [Ping timeout: 245 seconds]
linack has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 245 seconds]
t58 has quit [Quit: Night]
dddddd has quit [Remote host closed the connection]
cropcircle has quit [Read error: Connection reset by peer]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 248 seconds]
FreeBirdLjj has joined #lisp
anewuser has joined #lisp
FreeBirdLjj has quit [Ping timeout: 272 seconds]
<beach> Good morning everyone!
dale has quit [Quit: dale]
igemnace_ is now known as igemnace
<Josh_2> Mornin'
notzmv has joined #lisp
shifty has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 248 seconds]
<Josh_2> Github saying one of my projects is using newlisp xD
pillton has joined #lisp
caltelt has quit [Ping timeout: 244 seconds]
corvidzz_ has quit [Ping timeout: 252 seconds]
orivej has joined #lisp
gravicappa has joined #lisp
corvidzz has joined #lisp
<aeth> Josh_2: I got that, too, but on Gitlab. They all use the same Ruby package that has a really simple regex and for newlisp it's something like "define-" which is ridiculous because CL has define-condition and lots of custom macros
<aeth> Josh_2: The workaround is to add a new .gitattributes file and have this be the one line: *.lisp linguist-language=Common Lisp
meepdeew has joined #lisp
Oladon has quit [Ping timeout: 244 seconds]
<aeth> as far as I'm concerned, that's part of the mandatory CL git boilerplate now, along with e.g. a gitignore that ignores all of the FASLs
<Josh_2> magit is awesome, it makes it all so easy
Kundry_Wag has joined #lisp
Bike has quit [Quit: Lost terminal]
Kundry_Wag has quit [Ping timeout: 244 seconds]
meepdeew has quit [Remote host closed the connection]
Arcaelyx has quit [Ping timeout: 258 seconds]
caltelt_ has quit [Ping timeout: 259 seconds]
meepdeew has joined #lisp
anewuser has quit [Quit: anewuser]
Kundry_Wag has joined #lisp
akssri has joined #lisp
Kundry_Wag has quit [Ping timeout: 244 seconds]
vlatkoB has joined #lisp
akssri has quit [Quit: IRC for Sailfish 0.9]
pankajgodbole has joined #lisp
pankajgodbole has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
meepdeew has quit [Remote host closed the connection]
Kundry_Wag has quit [Ping timeout: 272 seconds]
SaganMan has joined #lisp
sauvin has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 246 seconds]
makomo has joined #lisp
v88m has quit [Read error: Connection reset by peer]
v88m has joined #lisp
nmg has joined #lisp
_whitelogger has joined #lisp
_leb has quit []
igemnace has quit [Read error: Connection reset by peer]
Kundry_Wag has joined #lisp
igemnace has joined #lisp
linack has quit [Quit: Leaving]
Kundry_Wag has quit [Ping timeout: 258 seconds]
varjag has joined #lisp
karlosz has quit [Quit: karlosz]
JohnMS_WORK has joined #lisp
varjag has quit [Ping timeout: 246 seconds]
Kundry_Wag has joined #lisp
Arcaelyx has joined #lisp
ym555 has joined #lisp
Kundry_Wag has quit [Ping timeout: 248 seconds]
ym555_ has quit [Ping timeout: 258 seconds]
jack_rabbit has quit [Ping timeout: 248 seconds]
jprajzne has joined #lisp
<eabarbosa> or having at files top: ;; -*-lisp-*-
schweers has joined #lisp
Necktwi has quit [Remote host closed the connection]
dkmuelle1 has quit [Quit: WeeChat 2.2]
jack_rabbit has joined #lisp
ofi has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 272 seconds]
scymtym has joined #lisp
schjetne has joined #lisp
techquila has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 248 seconds]
scymtym has quit [Ping timeout: 252 seconds]
varjag has joined #lisp
_whitelogger has joined #lisp
flamebeard has joined #lisp
hhdave has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 258 seconds]
flazh has quit [Ping timeout: 268 seconds]
Inline has quit [Quit: Leaving]
flazh has joined #lisp
eabarbosa has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 245 seconds]
Kundry_Wag has joined #lisp
pierpal has joined #lisp
schjetne has quit [Remote host closed the connection]
manualcrank has quit [Quit: WeeChat 1.9.1]
Kundry_Wag has quit [Ping timeout: 258 seconds]
heisig has joined #lisp
schjetne has joined #lisp
SaganMan has quit [Ping timeout: 258 seconds]
v88m has quit [Ping timeout: 258 seconds]
SaganMan has joined #lisp
ggole has joined #lisp
wigust has quit [Ping timeout: 246 seconds]
wigust has joined #lisp
Nilby has joined #lisp
zooey has quit [Remote host closed the connection]
zooey has joined #lisp
flamebeard has quit []
keep_learning_M has quit [Quit: This computer has gone to sleep]
Kundry_Wag has joined #lisp
schjetne has quit [Ping timeout: 246 seconds]
Kundry_Wag has quit [Ping timeout: 272 seconds]
v88m has joined #lisp
scymtym has joined #lisp
Roargh has joined #lisp
igemnace has quit [Ping timeout: 258 seconds]
Kundry_Wag has joined #lisp
crystalball has joined #lisp
crystalball has quit [Client Quit]
Josh_2 has quit [Read error: Connection reset by peer]
Kundry_Wag has quit [Ping timeout: 258 seconds]
nmg has quit [Remote host closed the connection]
igemnace has joined #lisp
m00natic has joined #lisp
test1600 has joined #lisp
shangul has joined #lisp
crystalball has joined #lisp
gareppa has joined #lisp
kajo has quit [Ping timeout: 250 seconds]
gareppa has quit [Remote host closed the connection]
kajo has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 272 seconds]
test1600_ has joined #lisp
test1600__ has joined #lisp
elderK has quit [Quit: Connection closed for inactivity]
test1600 has quit [Ping timeout: 244 seconds]
Zaab1t has joined #lisp
test1600 has joined #lisp
test1600_ has quit [Ping timeout: 258 seconds]
Zaab1t has quit [Remote host closed the connection]
test1600__ has quit [Ping timeout: 258 seconds]
crystalball has quit []
test1600 has quit [Client Quit]
asdf_asdf_asdf has joined #lisp
pankajgodbole has joined #lisp
SaganMan has quit [Quit: WeeChat 1.6]
xantoz has quit [Ping timeout: 258 seconds]
Kundry_Wag has joined #lisp
<phoe> Is anyone aware of some kind of server in Common Lisp that can accept an arbitrary number of TCP connections and pushes the messages it receives into some sort of queue?
<shka__> create TCP router socket
<phoe> I'm fed up with trying to write a robust one myself and I'd rather use a solution that doesn't break in subtle ways.
<shka__> do you control the protocol on both ends
<shka__> ?
igemnace has quit [Read error: Connection reset by peer]
Kundry_Wag has quit [Ping timeout: 272 seconds]
<phoe> yes
igemnace has joined #lisp
<shka__> ok
<shka__> in this case, i would grab ZMQ
<shka__> it is not lisp, but C api is simple enough and lib is robust
<phoe> Will it work in a client-server architecture?
<shka__> yes
<shka__> i used it numerous times, i can't recommend it enough
<phoe> Can I use it to send messages between a server and any number of clients?
<shka__> yup, in a multiple ways
<shka__> it will also manage queues and stuff
dddddd has joined #lisp
<shka__> there are lisp bindings pzmq
<shka__> they are not perfect, but you could make your own bindings in like one evening
<shka__> there are some tricky things in the API like dropping messages, high water marks but there is a plenty of people using this already so getting help should be simpler
<pjb> phoe: Not at the level of TCP connection, but of IRC message, there's the botil example: https://github.com/informatimago/lisp/tree/master/small-cl-pgms/botil
<_death> the zmq guide is also a must read
<shka__> yeah, it is not bad
amerlyq has joined #lisp
Bike has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 248 seconds]
_whitelogger has joined #lisp
gxt has quit [Ping timeout: 252 seconds]
metallicus has joined #lisp
metallicus has quit [Client Quit]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 252 seconds]
orivej has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
ebrasca has joined #lisp
sunset_NOVA has joined #lisp
DGASAU has quit [Read error: Connection reset by peer]
wxie has joined #lisp
amerlyq has quit [Quit: amerlyq]
Kundry_Wag has joined #lisp
ym555 has quit [Quit: leaving...]
Necktwi has joined #lisp
Kundry_Wag has quit [Ping timeout: 246 seconds]
kajo has quit [Ping timeout: 252 seconds]
_leb has joined #lisp
lavaflow has quit [Ping timeout: 268 seconds]
ofi has quit [Remote host closed the connection]
DGASAU has joined #lisp
warweasle has joined #lisp
Kundry_Wag has joined #lisp
_leb has quit []
Kundry_Wag has quit [Ping timeout: 268 seconds]
emar has left #lisp [#lisp]
cronolio has joined #lisp
amerlyq has joined #lisp
lavaflow has joined #lisp
heisig has quit [Quit: Leaving]
dale_ has joined #lisp
dale_ is now known as dale
<shangul> Any library/module which converts ratios/fractions to decimal digits?
<shangul> (I don't know what to search for this)
<shka__> shangul: yes
<shka__> (coerce 'single-float)
lumm has joined #lisp
<shka__> CL has ratios build in, they can be coerced into floats, and now this is trivial
<schweers> shangul: I think you rather want arbitrary precision floating points.
<White_Flame> or FORMAT to literally get a sequence of decimal digit characters
<shangul> White_Flame, the format function?
<White_Flame> yes
<schweers> shangul: maybe you can create a large integer out of your fraction and emit it. placing the string "3." in front of it
<shangul> schweers, how?
<White_Flame> or multiply it by 10^n first, to get a fixed-point decimal value
<White_Flame> of arbitrary precision
<schweers> ^
<White_Flame> shangul: what sort of precision do you need?
<shangul> White_Flame, I can't just multiply by 10^n
<jackdaniel> common lisp has bignums, *yes you can* ,) admittedly that depends how much memory you have on your system
FreeBirdLjj has joined #lisp
<schweers> shangul: why can’t you do that?
<shangul> what about 1/3?
<White_Flame> if you multiply by 1000, for instance, then FLOOR it to an integer, the rendering of it might be "1234567" which would correspond to "1234.567"
wxie has quit [Ping timeout: 250 seconds]
<White_Flame> 1/3 * 1000 as an integer = 333
<White_Flame> corresponding to 0.333
<shangul> White_Flame, and how should I know that I should multiply by 10^3 for example?
<White_Flame> that would be your input requirement, in this case "I want 3 decimal digits of fractional precision"
<jackdaniel> shangul: I think you need to be more precise with "what you want" before anyone can give you better hints on how to do that
<White_Flame> and you could go as high as you want, well beyond what built-in floating point gives you
<shangul> jackdaniel, you are right
<White_Flame> the reason I asked about precision is that if your requirements fit in single or double floats, just use those
<jackdaniel> (or long float! not all implementations trim long-float to double-float)
<shangul> I'm trying to calculate Pi. I've written a function returning a fraction/ratio which is Pi but I'm not sure how can extract digits of Pi
<jackdaniel> you want all of them digits?
<dlowe> you... can't... rationalize... pi
<White_Flame> a ratio cannot represent pi
<shangul> White_Flame, right. not exactly pi but a value close to it
<grewal_> 22/7 is good enough for me
<White_Flame> okay, so again, *how* close, iow what precision do you need?
<Bike> you have a ratio and you want digits?
<jackdaniel> shangul: then (coerce your-ratio 'long-float)
<shangul> jackdaniel, Is it as long as I want?
<White_Flame> 32-bit floats ar ~7 decimal digits, 64-bit floats are ~16
<shangul> for example 1000 digits or more?
<Bike> it might be, but there's no guarantee.
<jackdaniel> shangul: I don't know how long you want ,)
<Bike> i would call it unlikely.
<dlowe> if it's more digits than your ratio, they will be wrong
<White_Flame> then multiply by 10^1000 and print it as an int
<White_Flame> taking the last 1000 digits as fractional
<White_Flame> (might take a while, but for this level of code that's to be expected)
<shangul> White_Flame, the problem is that I don't know how many digits I want. In that case 1000 was just an example
<Bike> then change 1000 to whatever.
<White_Flame> however many iterations your calculation performs determines how precise it gets
<shangul> Bike, to what?
<Bike> watch: (floor (* 22/7 100) 10) => 31
<Bike> presto, two digits
<Bike> because 100 is 10^2
<schweers> shangul: try increasing values until the right hand side is just zeros?
<shangul> schweers, no. 1/3
<Bike> (floor (* 22/7 1000) 10) => 314
<schweers> you’ve got a point.
<White_Flame> Bike: you don't need the 10
<Bike> oh, yeah.
<shangul> schweers, but that works for other fractions. for example 1/2^100
<White_Flame> (floor (* 22/7 1000)) = 3142, with 1000 = 10^3 for 3 fractional digits
<Bike> right.
<Bike> doy.
<schweers> This seems to be a case of not understanding the problem space well enough. This does not necessarily have to do anything with lisp.
varjag has joined #lisp
<Bike> it's more about math than lisp, yeah.
<shangul> perhaps you are right
<White_Flame> well, with arbitrary precision floating point libs, there could be specifics about them
<White_Flame> but it's solvable with just the built-ins, and not that difficultly
<jackdaniel> printing "pi digits" sounds suspicious too ,)
<White_Flame> but still, you need to know your precision!
<shangul> White_Flame, that's the problem!
<jackdaniel> i.e for many cases 3 is an acceptably accurate pi :-)
<White_Flame> also, there are algorithms to calculate arbitrary decimal digits of pi, random-access style, iirc
<White_Flame> shangul: that's your math, nothing to do with this problem
igemnace has quit [Ping timeout: 258 seconds]
<jackdaniel> (do-what-i-want-dammit! pi)
<shangul> okay joining ##math
cosimone has joined #lisp
<grewal_> shangul: Since you want digits, a spigot algorithm might be a better choice
sjl_ has quit [Quit: WeeChat 2.3-dev]
sjl_ has joined #lisp
cosimone has quit [Ping timeout: 252 seconds]
cosimone has joined #lisp
Zaab1t has joined #lisp
igemnace has joined #lisp
asdf_asdf_asdf has quit [Ping timeout: 256 seconds]
pfdietz_ has joined #lisp
pfdietz has quit [Ping timeout: 256 seconds]
lavaflow has quit [Ping timeout: 244 seconds]
v88m has quit [Ping timeout: 272 seconds]
meepdeew has joined #lisp
meepdeew has quit [Remote host closed the connection]
rippa has joined #lisp
meepdeew has joined #lisp
meepdeew has quit [Ping timeout: 248 seconds]
shifty has quit [Ping timeout: 246 seconds]
skidd0 has joined #lisp
Zaab1t has quit [Quit: bye bye friends]
pierpal has quit [Ping timeout: 258 seconds]
Zaab1t has joined #lisp
q-u-a-n has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
Kabriel_ has joined #lisp
FreeBirdLjj has joined #lisp
iovec has joined #lisp
milanj has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
karlosz has joined #lisp
schweers has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
JohnMS_WORK has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
lavaflow has joined #lisp
Jesin has quit [Quit: Leaving]
q-u-a-n has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
sunset_NOVA has quit [Quit: leaving]
Roargh has quit [Quit: Leaving]
Jesin has joined #lisp
FreeBirdLjj has joined #lisp
Jesin has quit [Remote host closed the connection]
schjetne has joined #lisp
maxxcan has joined #lisp
FreeBirdLjj has quit [Ping timeout: 272 seconds]
Jesin has joined #lisp
cross has joined #lisp
pillton has quit [Read error: Connection reset by peer]
linli has joined #lisp
FreeBirdLjj has joined #lisp
hhdave has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
dacoda has joined #lisp
Inline has joined #lisp
anewuser has joined #lisp
nowhere_man has joined #lisp
eschatologist has quit [Excess Flood]
eschatologist has joined #lisp
jprajzne has quit [Remote host closed the connection]
ym555 has joined #lisp
_leb has joined #lisp
q-u-a-n has quit [Remote host closed the connection]
m00natic has quit [Remote host closed the connection]
maxxcan has quit [Quit: maxxcan]
linli has quit [Remote host closed the connection]
pankajgodbole has quit [Ping timeout: 252 seconds]
Kundry_Wag has joined #lisp
eschatologist has quit [Excess Flood]
eschatologist has joined #lisp
swflint has quit [Ping timeout: 252 seconds]
swflint has joined #lisp
nanoz has joined #lisp
scymtym has quit [Ping timeout: 248 seconds]
v88m has joined #lisp
cosimone has quit [Quit: WeeChat 2.3]
ravenous_ has joined #lisp
Kundry_Wag has quit [Ping timeout: 244 seconds]
Kundry_Wag has joined #lisp
anewuser has quit [Read error: Connection reset by peer]
Nilby has quit [Remote host closed the connection]
cosimone has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Zaab1t has quit [Quit: bye bye friends]
nowhere_man has quit [Ping timeout: 246 seconds]
ym555 has quit [Ping timeout: 258 seconds]
Kundry_Wag has quit [Ping timeout: 245 seconds]
ggole has quit [Quit: Leaving]
manualcrank has joined #lisp
dacoda has quit [Ping timeout: 248 seconds]
milanj has quit [Quit: This computer has gone to sleep]
cosimone has quit [Quit: WeeChat 2.3]
kajo has joined #lisp
sauvin has quit [Ping timeout: 258 seconds]
anamorphic has joined #lisp
samlamamma has joined #lisp
maxxcan has joined #lisp
maxxcan has quit [Client Quit]
lumm_ has joined #lisp
lumm has quit [Ping timeout: 258 seconds]
lumm_ is now known as lumm
gravicappa has quit [Ping timeout: 248 seconds]
torbo has joined #lisp
gxt has joined #lisp
lumm has quit [Quit: lumm]
lumm has joined #lisp
samlamamma has quit [Read error: Connection reset by peer]
<skidd0> I am struggling with slot-boundp
<skidd0> i cannot figure out how to pass the slot-name it needs
<mfiano> What did you try and what does your class definition look like?
<skidd0> i have a product class with a google-product-type slot
<skidd0> an instance of this is stored in symbol p
<skidd0> (slot-boundp p google-product-type) or :google-product-type (the accessor)
<mfiano> slot-boundp does not take a slot value. It takes a slot name
<Xach> skidd0: slot-boundp is a function, and follows normal evaluation rules. so to pass a name (represented by a symbol) you must make sure the argument evaluates to the right symbol. it's common to use ' for that.
vlatkoB has quit [Remote host closed the connection]
<Xach> (slot-boundp p 'google-product-type) might work if the current package is appropriate.
<mfiano> Oh I see. Nevermind. Yeah what Xach said
<skidd0> so the p symbol should be 'p?
<skidd0> or the google-..?
<skidd0> or both
<Xach> skidd0: no. p evalutes to the object instance. the second argument must evaluate to the name.
<mfiano> No, it should be exactly what Xach wrote, assuming your slot name (not accessor) is GOOGLE-PRODUCT-TYPE
<Xach> skidd0: quoting it will make it evaluate to the name.
<Xach> or to a symbol, rather - whether it's the right one depends on how the class is defined.
<pjb> skidd0: (defclass point () ((x :initform 3) (y))) (let ((object (make-instance 'point))) (slot-boundp object (progn (write-string "what slot?" *query-io*) (finish-output *query-io*) (read *query-io*)))
<skidd0> okay, got it working now, thanks. so the quote operator ensures i'm passing in the symbol google-product-name rather than evaluating google-product-name and passing the evaluation in?
<pjb> Sure.
nanoz has quit [Ping timeout: 272 seconds]
<mfiano> In Common Lisp, arguments to functions are evaluated before the function is applied to those values, so it's common to use QUOTE to prevent evaluation in this case, since you only want the name of the slot, not what symbol-value may be currently bound to the symbol.
<skidd0> right okay
<pjb> skidd0: or you can compute the slot name.
<skidd0> with (sb-mop:class-slots ..)?
<pjb> (slot-boundp (make-instance 'point) (intern "X")) #| --> t |# (slot-boundp (make-instance 'point) (intern "Y")) #| --> nil |#
<pjb> or with the mop, yes.
gareppa has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
ravenous_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
karlosz has quit [Remote host closed the connection]
schjetne has quit [Ping timeout: 272 seconds]
refpga has joined #lisp
Inline has quit [Remote host closed the connection]
oni-on-ion has joined #lisp
<refpga> Hello, how can I convert a list of lists and atoms to a single list of atoms? like (5 (2 3) (45 7)) to (5 2 3 45 7). Earlier I was using (reduce #'append list) but that only works if all the elements of the list are lists.
<mfiano> alexandria:flatten
gareppa has quit [Quit: Leaving]
<refpga> Thanks
<mfiano> Keep in mind, a vectors are atoms too. If you would like it to flatten array elements as well, it requires a slight modification.
<mfiano> s/a//
Inline has joined #lisp
<refpga> Thanks man
ckonstanski has joined #lisp
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
shangul has quit [Ping timeout: 248 seconds]
varjag has quit [Ping timeout: 246 seconds]
varjag has joined #lisp
Krystof has quit [Read error: Connection reset by peer]
igemnace has quit [Quit: WeeChat 2.4]
gareppa has joined #lisp
gareppa has quit [Remote host closed the connection]
jmercouris has joined #lisp
Krystof has joined #lisp
dkmueller has joined #lisp
nckx has quit [Quit: Updating my GNU Guix System <https://guix.gnu.org>]
nckx has joined #lisp
skidd0 has quit [Quit: WeeChat 2.4]
<jmercouris> hello everyone
lavaflow has quit [Ping timeout: 244 seconds]
gxt has quit [Quit: WeeChat 2.4]
Lycurgus has joined #lisp
anewuser has joined #lisp
lavaflow has joined #lisp
Bike has quit []
[rg] has joined #lisp
phoe has quit [Ping timeout: 264 seconds]
phoe has joined #lisp
vms14 has joined #lisp
aindilis has quit [Read error: Connection reset by peer]
<vms14> guys, should I avoid let and use arguments as much as possible?
<vms14> for example
<vms14> (defun len (list &optional (number 1))
<vms14> (if (null (cdr list))
<vms14> number
<vms14> (len (cdr list) (incf number))))
<vms14> is better practice to put number as an optional argument than using let?
<jmercouris> vms14: please use a paste service such as pastebin
<jmercouris> you can use an optional argument with a default
<vms14> yeah, that's what I'm doing, but I'm doing those simple exercises
<vms14> I'm avoiding to use let, it's right to avoid using let and prefer optional arguments?
<jmercouris> well, it really depends on the context
<vms14> I remember some lisper here told me something about threads and let
<jmercouris> let has its purpose
<pjb> vms14: if it's not a parameter, then no.
<vms14> pjb: what you mean?
<aeth> vms14: that style is basically Scheme style, not Common Lisp style
<pjb> vms14: technically, for local variables you could use &aux, but let is more readable IMO.
<aeth> &aux is basically never used because it's less readable.
<pjb> vms14: I mean that &optional is an input to the function. You don't want the callers to be able to mess with your local variables (at least their initialization).
<pjb> &aux is made for macros, to avoid having to parse the bodies for declarations and docstrings.
<vms14> pjb: so then it's better to use let in this case?
<pjb> Always.
<pjb> vms14: now, if you want to use an accumulator, you could use a local function with LABELS. But any non-mandatory parameter will be slower to process, so you definitely don't want them in "inner loops" ie. inner recursions.
<grewal_> Also, the function is wrong. It'll give the length of () as 1.
<vms14> won't let incite me to write more iterative code?
<vms14> grewal_: xD
amerlyq has quit [Quit: amerlyq]
<aeth> vms14: In case it's unclear, then len you wrote shouldn't be exposed to the user. Just make it a second function (or an internal function with labels) and have the actual len only take in a list
<aeth> This is a common pattern for tail recursive functions, which are more of a Scheme thing than a CL thing
<vms14> yeah, but the scheme way is functional and pure recursion
<vms14> I need to get used to recursion
<vms14> also I've read that functional and lisp come together
<aeth> vms14: This is how I implemented infix s-expressions (i.e. it's not "1+1" it's (1 + 1)): https://gitlab.com/snippets/1747132
<vms14> now I can read the code
<vms14> some time ago I tried to read the code lispers gave me, but understood nothing
<vms14> why consp rather than listp?
<vms14> there is a difference?
<aeth> listp accepts nil
<aeth> If you listp then you have to have a case that handles nil
<vms14> tnx
<aeth> It has been a while since I wrote that code but it looks like I handle nil by simply checking for the existence of tail before calling the next iteration
<aeth> Instead of the more traditional way of having a case that handles endp (or null) at the top of a cond
<aeth> I guess maybe I should handle the empty list at the top level (before the labels recursion) but that's not really an infix list if it's empty and there's no symbol. An infix list basically requires 3 elements as its minimum.
<vms14> you could use reader macros and change the grammar
<vms14> so it will really read directly the parsed list
<vms14> and wrap this in a macro which changes the readtable locally
<vms14> I want to play with the readtable, must be fun
<aeth> Well, speaking of reader macros... someone was talking in another Lisp channel a week ago about how C++ has the ugliest hello world so I reused my infix parser to make this: https://gitlab.com/mbabich/lisp-hello-world/blob/c45deaab9918285d3de43c52340100fef6591d15/main.lisp
<aeth> I did it very quickly. With more time, I could probably make it semantically match C++ more (but then I'd have to relearn that part of C++ first)
<vms14> nice
<vms14> will serve me as example
<aeth> All I did was turn that infix function into a macro (a one-liner) and then wrote a << macro in 10 lines and then wrote a reader macro in 11 lines
<aeth> It didn't take m uch to turn parse-infix-list into a reader macro. https://gitlab.com/mbabich/lisp-hello-world/blob/c45deaab9918285d3de43c52340100fef6591d15/infix.lisp
<aeth> Unfortunately, it's not portable because a Lisp implementation doesn't have to implement tail recursion... although I really hope you wouldn't blow the stack with a massive amount of infix.
<refpga> Hi, how can I inspect objects (a graph-container in particular) in the slime repl?
Folkol has quit [Quit: Textual IRC Client: www.textualapp.com]
<aeth> refpga: get it to be printed to the SLIME REPL and then: right click and inspect or M-x slime-inspect-presentation-at-point or C-c C-v TAB
Lord_of_Life_ has joined #lisp
lumm has quit [Read error: Connection reset by peer]
Lord_of_Life has quit [Ping timeout: 268 seconds]
Lord_of_Life_ is now known as Lord_of_Life
anamorphic has quit [Quit: anamorphic]
moldybits has quit [Ping timeout: 258 seconds]
<vms14> what socket library would you use?
lavaflow has quit [Read error: Connection reset by peer]
<vms14> I'm planning to just use the socket library from sbcl
lavaflow has joined #lisp
<vms14> but I see there is usocket and should work on most implementations, so will make it more portable
dkmueller has quit [Quit: WeeChat 1.6]
q-u-a-n2 has joined #lisp
Lycurgus has quit [Quit: Exeunt]
moldybits has joined #lisp
caltelt has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
anamorphic has joined #lisp
lonjil has quit [Remote host closed the connection]
eabarbosa has joined #lisp
t58 has joined #lisp
wxie has joined #lisp
Bike has joined #lisp
igemnace has joined #lisp
sjl_ has quit [Ping timeout: 245 seconds]
wxie has quit [Quit: wxie]
moldybits has quit [Quit: WeeChat 2.4]
eabarbosa has quit [Ping timeout: 258 seconds]
igemnace has quit [Quit: WeeChat 2.4]
shifty has joined #lisp
ckonstanski has quit [Read error: Connection reset by peer]
makomo has quit [Ping timeout: 258 seconds]
iovec has quit [Quit: Connection closed for inactivity]
igemnace has joined #lisp
elderK has joined #lisp
v88m has quit [Ping timeout: 248 seconds]
nowhere_man has joined #lisp
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
paraparity has joined #lisp
jmercouris has quit [Remote host closed the connection]
rumbler31 has quit [Ping timeout: 258 seconds]
vms14 has quit [Quit: WeeChat 2.3]
eabarbosa has joined #lisp
mrcom has joined #lisp