jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language<http://cliki.net/> logs:<https://irclog.whitequark.org/lisp,http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.5, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
mflem has quit [Ping timeout: 245 seconds]
quazimodo has quit [Ping timeout: 256 seconds]
attila_lendvai has quit [Quit: Leaving.]
quazimodo has joined #lisp
Kundry_Wag has joined #lisp
aindilis has quit [Read error: Connection reset by peer]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
aindilis has joined #lisp
Kundry_W_ has quit [Remote host closed the connection]
aindilis has quit [Read error: Connection reset by peer]
Kundry_W_ has joined #lisp
dented42 has joined #lisp
fikka has joined #lisp
aindilis has joined #lisp
Fare has joined #lisp
Kundry_Wag has quit [Ping timeout: 276 seconds]
subroot has quit [Read error: Connection reset by peer]
Kundry_W_ has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 260 seconds]
Kaisyu7 has joined #lisp
knicklux has quit [Ping timeout: 256 seconds]
knicklux has joined #lisp
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kundry_Wag has joined #lisp
pjb` has joined #lisp
pjb has quit [Ping timeout: 245 seconds]
pierpa has quit [Ping timeout: 260 seconds]
Arcaelyx has joined #lisp
knicklux has quit [Ping timeout: 240 seconds]
pjb`` has joined #lisp
pierpa has joined #lisp
nickenchuggets has quit [Read error: Connection reset by peer]
knicklux has joined #lisp
nickenchuggets has joined #lisp
pjb` has quit [Ping timeout: 245 seconds]
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
brendyn has joined #lisp
brendarn has joined #lisp
pjb`` has quit [Ping timeout: 256 seconds]
SaganMan has joined #lisp
Kundry_Wag has quit [Read error: No route to host]
Kundry_Wag has joined #lisp
orivej has quit [Ping timeout: 260 seconds]
knicklux has quit [Ping timeout: 248 seconds]
igemnace has joined #lisp
knicklux has joined #lisp
dddddd has quit [Remote host closed the connection]
markoong has quit [Quit: Konversation terminated!]
markoong has joined #lisp
brendarn has quit [Quit: WeeChat 2.1]
vmmenon has quit [Quit: vmmenon]
markoong has quit [Ping timeout: 265 seconds]
smurfrobot has quit [Remote host closed the connection]
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
smurfrobot has joined #lisp
Kundry_Wag has quit [Ping timeout: 264 seconds]
Fare has quit [Ping timeout: 276 seconds]
pierpal has joined #lisp
karlosz has quit [Ping timeout: 245 seconds]
skeuomorf has joined #lisp
pierpal has quit [Ping timeout: 260 seconds]
Kundry_Wag has joined #lisp
mflem has joined #lisp
fikka has joined #lisp
jonh has left #lisp ["WeeChat 1.4"]
Kundry_Wag has quit [Ping timeout: 240 seconds]
rumbler31 has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
Kundry_Wag has joined #lisp
Arcaelyx_ has joined #lisp
Fare has joined #lisp
pagnol has quit [Ping timeout: 240 seconds]
Kundry_Wag has quit [Ping timeout: 248 seconds]
Arcaelyx has quit [Ping timeout: 260 seconds]
nowhere_man has quit [Ping timeout: 245 seconds]
nowhere_man has joined #lisp
SaganMan has quit [Read error: Connection reset by peer]
smurfrobot has quit [Remote host closed the connection]
karlosz has joined #lisp
Arcaelyx_ is now known as Arcaelyx
smurfrobot has joined #lisp
fikka has joined #lisp
eli_oat has joined #lisp
Pixel_Outlaw has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
smurfrobot has quit [Remote host closed the connection]
SaganMan has joined #lisp
smurfrobot has joined #lisp
pierpal has joined #lisp
kolb has quit [Read error: Connection reset by peer]
ioa has quit [Read error: Connection reset by peer]
ioa has joined #lisp
mrottenkolber has joined #lisp
mrottenkolber is now known as Guest44929
eli_oat has quit [Quit: Leaving.]
robotoad has quit [Quit: robotoad]
Fare has quit [Ping timeout: 248 seconds]
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
igemnace has quit [Ping timeout: 240 seconds]
Fare has joined #lisp
skidd0 has quit [Quit: 0/]
asarch has joined #lisp
jason_m has quit [Ping timeout: 265 seconds]
dented42 has joined #lisp
EvW has quit [Ping timeout: 265 seconds]
FreeBirdLjj has joined #lisp
smurfrobot has quit [Remote host closed the connection]
fikka has joined #lisp
FreeBirdLjj has quit [Ping timeout: 240 seconds]
rumbler31 has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 276 seconds]
robotoad has joined #lisp
fisxoj has quit [Quit: fisxoj]
shifty has joined #lisp
<on_ion> froggey: seen this? https://github.com/grz0zrg/fbg
robotoad has quit [Quit: robotoad]
pierpa has quit [Quit: Page closed]
varjag has joined #lisp
jibanes has quit [Ping timeout: 240 seconds]
varjag has quit [Ping timeout: 240 seconds]
robotoad has joined #lisp
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jibanes has joined #lisp
smurfrobot has joined #lisp
jibanes has quit [Ping timeout: 268 seconds]
jibanes has joined #lisp
Oladon has joined #lisp
rumbler31 has joined #lisp
knicklux has quit [Ping timeout: 264 seconds]
schoppenhauer has quit [Ping timeout: 268 seconds]
smurfrobot has quit [Remote host closed the connection]
schoppenhauer has joined #lisp
fikka has joined #lisp
rumbler31 has quit [Ping timeout: 276 seconds]
igemnace has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
knicklux has joined #lisp
Pixel_Outlaw has quit [Remote host closed the connection]
<aeth> What do people use for Lisp testing? I've seen two. Roswell. And now this lisp-devel Docker. https://lispcookbook.github.io/cl-cookbook/testing.html#gitlab-ci https://hub.docker.com/r/daewok/lisp-devel/
fikka has joined #lisp
nickenchuggets has quit [Read error: Connection reset by peer]
fikka has quit [Ping timeout: 268 seconds]
low_brain_cache has joined #lisp
Bike has quit [Quit: Lost terminal]
shangul has joined #lisp
<edgar-rft> aeth: there's an ANSI test suite for testing Lisp, but I assume that you're not looking what you're asking for.
igemnace has quit [Read error: Connection reset by peer]
karlosz has quit [Quit: karlosz]
fikka has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
fikka has quit [Ping timeout: 248 seconds]
<aeth> edgar-rft: No, I mean testing Lisp code in the cloud
Oladon has quit [Quit: Leaving.]
igemnace has joined #lisp
SaganMan has quit [Ping timeout: 248 seconds]
fikka has joined #lisp
daniel-s has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
Ukari has quit [Ping timeout: 248 seconds]
fikka has joined #lisp
smurfrobot has joined #lisp
andrei-n has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
igemnace has quit [Quit: WeeChat 2.1]
<beach> Good morning everyone!
fikka has joined #lisp
<low_brain_cache> good morning
<beach> low_brain_cache: Are you new here? I don't recognize your nick.
<low_brain_cache> I haven't registered a nick but I've been on here as beginner_supreme, cl0s, Common_Lisp (I think), etc.
<beach> I see.
<low_brain_cache> I like to read the conversations on here and learn.
Ukari has joined #lisp
<beach> I understand.
fikka has quit [Ping timeout: 268 seconds]
mangul has joined #lisp
shangul has quit [Ping timeout: 240 seconds]
mangul is now known as shangul
<low_brain_cache> I figure that since nicks are temporary assuming low activity, and registering a nick doesn't necessarily disallow others from using it, there's no reason to register
<low_brain_cache> But I'm not knowledgable about IRC per say so..
<beach> You do get a password when you register. I don't know how secure it is of course.
mangul has joined #lisp
lavaflow has quit [Read error: Connection reset by peer]
lavaflow has joined #lisp
Kundry_Wag has joined #lisp
shangul has quit [Disconnected by services]
mangul is now known as shangul
<LdBeth> Good afternoon
Oladon has joined #lisp
<LdBeth> I believe freenode also allow to register several different nick under one mail address for bot or something
Kundry_Wag has quit [Ping timeout: 240 seconds]
<low_brain_cache> Is there a freenode manual of commands? /help lists a table but /help <command> doesn't do anything. <- Sorry for the non-lisp question but since we're on the topic of IRC... ;)
Fare has quit [Ping timeout: 245 seconds]
<LdBeth> low_brain_cache: many commands are IRC client specific, so you should find your own manual
<low_brain_cache> Oh I see
fikka has joined #lisp
flamebeard has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
<low_brain_cache> Have a good night everyone! Can't stay awake any longer
<beach> 'night low_brain_cache.
low_brain_cache has quit []
fikka has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
vlatkoB has joined #lisp
Kundry_Wag has joined #lisp
asarch has quit [Quit: Leaving]
fikka has joined #lisp
Kundry_Wag has quit [Ping timeout: 276 seconds]
fikka has quit [Ping timeout: 276 seconds]
Inline has quit [Quit: Leaving]
fikka has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
shrdlu68 has joined #lisp
orivej has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
FreeBirdLjj has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
fikka has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
Patternmaster has quit [Quit: leaving]
fikka has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
thodg has joined #lisp
skeuomorf has quit [Ping timeout: 264 seconds]
fikka has quit [Ping timeout: 265 seconds]
fikka has joined #lisp
vsync has quit [Ping timeout: 256 seconds]
doesthiswork has joined #lisp
vsync has joined #lisp
vsync has quit [Max SendQ exceeded]
on_ion is now known as oni-on-ion
vsync has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
oni-on-ion is now known as onion
onion is now known as oni-on-ion
Folkol_ has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 276 seconds]
varjag has joined #lisp
angavrilov has joined #lisp
daniel-s_ has joined #lisp
daniel-s has quit [Ping timeout: 240 seconds]
knicklux has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
X-Scale has quit [Quit: HydraIRC -> http://www.hydrairc.com <- Would you like to know more?]
knicklux has joined #lisp
Cymew has joined #lisp
crsc has quit [Quit: leaving]
crsc has joined #lisp
MichaelRaskin has quit [Quit: MichaelRaskin]
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
shrdlu68 has left #lisp [#lisp]
robotoad has quit [Quit: robotoad]
makomo has quit [Ping timeout: 264 seconds]
dddddd has joined #lisp
fikka has quit [Ping timeout: 276 seconds]
hajovonta has joined #lisp
<hajovonta> hi
kuribas has joined #lisp
fikka has joined #lisp
<kuribas> Hi, I've set inferior-lisp-program with customize to sbcl, however everytime I restart emacs, it gets reset to lisp. Any idea why?
<varjag> anyone here closely familiar with cl-async?
Oladon has quit [Quit: Leaving.]
<hajovonta> kuribas: I think this is an #emacs question, but I think you should set the state to "Save for future sessions"
<kuribas> hajovonta: yes, I did that.
<varjag> open your .emacs and see if it saved
<kuribas> it did
<kuribas> it's just not using it at startup
doesthiswork has quit [Quit: Leaving.]
fikka has quit [Ping timeout: 256 seconds]
<varjag> check with C-h-v what the variable is set to in the running instance
skapata has quit [Remote host closed the connection]
SenasOzys has joined #lisp
milanj has joined #lisp
knicklux has quit [Ping timeout: 268 seconds]
fikka has joined #lisp
scymtym has joined #lisp
knicklux has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
<kuribas> lisp
<kuribas> well it was before, I set it to sbcl manually now.
fikka has joined #lisp
<kuribas> what's the equivalent of take-while (haskell) in common lisp?
<kuribas> takeWhile :: (a -> Bool) -> [a] -> [a]
<jdz> DOLIST?
shrdlu68 has joined #lisp
<kuribas> but without mutation?
<jdz> What mutation?
<jdz> Is this what takeWhile does? (loop for x in list while x collect x)?
<kuribas> while (test x)
<loke> jdz: I thought it was more like remove-if-not?
<loke> But I may be wrong
<kuribas> takeWhile isDigit "134abc" => "134"
<jdz> I have no idea. Defining questions in terms of what Haskell does in #lisp seems... wrong.
<kuribas> takeWhile isDigit "134abc523" => "134"
<jdz> (loop for x in list while (digit-char-p x) collect x)
<jdz> Works for lists.
<kuribas> and with dolist?
<jdz> Why do you want to do that with DOLIST?
<kuribas> jdz: you suggested it?
<jdz> Because I have no idea what you want.
<kuribas> yeah, that loop looks right
<jdz> (subseq sequence 0 (position-if-not #'digit-char-p sequence))
<kuribas> okay, thanks
<jdz> Lisp is not Haskell, so this most likely is not the best way to solve whatever problem it is you're solving.
<jdz> (parse-integer "134abc523" :junk-allowed t)
<kuribas> jdz: trimming whitespace
<jdz> STRING-TRIM
<jdz> clhs string-trim
wigust has joined #lisp
* jdz wonders what's the Haskell for STRING-RIGHT-TRIM is...
<kuribas> jdz: reverse . takeWhile isSpace . reverse
<loke> kuribas: Wouldn't that swimplyimply return the last spaces?
<kuribas> loke: ah right: reverse . dropWhile isSpace . reverse
<jdz> Simple, beautiful, efficient. Choose 2.
<loke> jdz: I think the haskell example is more like choose 0
<jdz> Heh.
<jdz> This is #lisp, we can bash Haskell to our heart's content.
<loke> No one will every convince me that reverse drop reverse is simple or beautiful. With a magic compiler is may be efficient. Maybe.
<jdz> Except too much of it is off-topic.
<jdz> Strings being lists does not help, eh?
<loke> jdz: Are they?
<jdz> Pretty sure they are in Haskell.
<loke> I don't know more than the absolute basics of Haskell
<loke> But... CATEGORY THEORY!
<lieven> the standard prelude has some awkward stuff in it. for real work, you should use Text for strings
<jdz> Right. And pattern matching works the same on Text?
<lieven> kinda sorta not really :)
<kuribas> jdz, loke for efficiency you'd use stripEnd on Text.
<jdz> Looks like cheating to me.
<jdz> Might as well write the whole thing in CL.
<kuribas> jdz: the same amount of cheating as string-trim
Fare has joined #lisp
<jdz> Then why all the talk about takeWhile when what you should have asked is stripStart?
<varjag> but in cl you are meant to cheat
<varjag> all purists are over in #scheme
<kuribas> I was reading this, and I found the lisp code quite ugly: https://markkarpov.com/post/lisp-and-haskell.html
<kuribas> might not be the best implementation though...
smurfrobot has quit [Remote host closed the connection]
<kuribas> varjag: yeah scheme is great
<varjag> some people should blog less and code more
<jdz> Right, first example, the MAP 'string should be plain DOLIST.
<jdz> Well, not DOLIST, LOOP. Or MAP nil.
MoziM has joined #lisp
smurfrobot has joined #lisp
ravndal has quit [Quit: WeeChat 2.1]
<kuribas> in haskell: addPadding str pad newline = intercalate ('\n' : replicate pad ' ') $ lines $ if newline then "\n" ++ str else str
<kuribas> there's a CL version of lines here: https://github.com/vindarel/cl-str
ravndal has joined #lisp
<hajovonta> Common Lisp is not a functional language, but it supports functional style programming.
<varjag> i'm sure it's even more elegant in perl
<loke> kuribas: Thtat link you sent
<loke> not only is it ugly Lisp. It's wrong and broken.
<jdz> I wonder why people who have no real experience with a programming language immediately have an urge to write articles titled "Why XXX is not my favourite programming language and why you should use YYY."?
<varjag> jdz: noone knows programming better than a fresh graduate
<kuribas> how would you write add-text-padding?
<hajovonta> "if your code compiles, it probably works" lol
<loke> kuribas: I'm not entirely sure what that function is supposed to do
<shrdlu68> kuribas: Are you the author of that blof post?
<loke> kuribas: Tell me what you want it to do and I'll tell you how to write it
<kuribas> shrdlu68: no
<shrdlu68> It's fizzbuzz time!
<kuribas> loke: prepend pad amount of spaces to each line except the first.
<hajovonta> loke I think (judging by the name) it takes a string and extends it with dummy characters or something like that
<loke> shrdlu68: Did you see the add-text-padding fuction? Wtf... w-o-t-s with a map 'string inside followed by a return that is never used?
<kuribas> loke: I don't care about the newline argument
<loke> Oh wait. he maps over the characters. And he seems to believe that 'string refers to the type of the thing he's mapping over
<jdz> kuribas: what is the ADD-TEXT-PADDING supposed to do?
<kuribas> jdz: see my comment for loke
<jdz> Add padding at the start of a line?
<loke> kuribas: so you want to add spaces to make every line the same length?
<loke> jdz: it seems to add it to the end
<jdz> Why is the first line special?
<kuribas> loke: no
<loke> Oh wait. you're right
<kuribas> jdz: I don't know
<kuribas> jdz: it's not my blog
<loke> So it just adds PADDING number of chars to the beginnign of each line
<jdz> Except the first one.
<loke> So he's just replacing #\Newline with <space...>#\Newline
<varjag> replace newline with newline + padding
<loke> yeah
<shrdlu68> So if new-line is nil it will return one line?
* loke would probably just use CL-PPCRE:REGEX-REPLACE-ALL
random-nick has joined #lisp
<loke> He claims he wrote unix-opts
<loke> I actually use that one
<jdz> Never mind that the original code has parameter named STR that is shadowed by LET binding.
<kuribas> how do you prepend newline in a string?
<jdz> OK, that's intended. Making a copy of input for no apparent reason. I wonder if the guy has tested his code?
<loke> I like his argument that QL doesn't use tests. But tests are required. Therefore QL is broken.
<loke> Instead of: QL doesn't need tests, and still works. Perhaps I'm wrong and tests are not the end-all-be-all?
<jdz> This function seems so convoluted it triggers all the possible wrong signals in my brain.
<loke> jdz: It probably _has_ tests, and therefore it's perfect. No matter hopw convoluted. The tests pass!
<kuribas> ok, so I have this, with the cl-string library: (join ((concat (string #\Newline) (repeat padding " "))) (lines str))
<kuribas> That actually looks like the haskell.
<kuribas> loke: regular expressions are messy.
<jdz> So many functions...
<jdz> If I had to work with lines I'd probably have a function MAP-LINES or something.
<kuribas> jdz: mapcar lines?
<jdz> No, MAP-LINES.
<jdz> Which would call a supplied function with 3 arguments: STRING, START and END.
<kuribas> that's less general
<jdz> It would also not be dog slow.
<kuribas> jdz: so show your version?
<jdz> Version of what?
<kuribas> add-text-padding
<jdz> It's a stupid function with convoluted requirements.
<jdz> I have real trouble wrapping my head around what it's supposed to do and in what circumstances one would use such a function.
<jdz> If only the author of the blog post had some test cases...
<kuribas> jdz: as I said before "prepend pad amount of spaces to each line except the first."
broccolistem has quit [Ping timeout: 276 seconds]
<kuribas> jdz: ok fine, you just want to criticise...
<varjag> something like that?
<varjag> would still rather use a library function
mflem has quit [Read error: Connection reset by peer]
|newbie| has joined #lisp
|newbie| has quit [Max SendQ exceeded]
<kuribas> varjag: what do those parenthesis across the newline do?
|newbie| has joined #lisp
|newbie| has quit [Client Quit]
m00natic has joined #lisp
Fzusgx has joined #lisp
Fzusgx has quit [Max SendQ exceeded]
Fzusgx has joined #lisp
Fzusgx has quit [Max SendQ exceeded]
<kuribas> jdz: ok thanks. I don't find it more elegant, but "de gustibus..."
<varjag> mine is elegant and inefficient
<varjag> which i believe is closest to haskell spirit
smurfrobot has quit [Remote host closed the connection]
<kuribas> varjag: haskell is pretty efficient, after inlining etc...
<kuribas> varjag: if you use Text, not String
<jdz> Elegance is subjective. I personally find my version straight-forward and directly matching the problem statement, and also not particularly inefficient.
<jdz> It is also very easy to change.
<kuribas> also about 4 times the size...
<jdz> The size of what?
<kuribas> the code
<kuribas> anyway, no point in discussing taste...
<kuribas> I just wanted to know what is the idiomatic lisp solution.
<jdz> Definitely not what's in the mentioned blog post.
<kuribas> yeah, I figured :)
defaultxr has quit [Ping timeout: 240 seconds]
<varjag> kuribas: idiomatic lisp solution is to use an existing library, implementing this efficiently
<varjag> cl-ppcre is a good start
<loke> varjag: What is the purpose of the MAKE-STRING?
<loke> Instead of that, couldn't you just do (STRING E)
skeuomorf has joined #lisp
<varjag> loke: you are right
<jdz> I don't think deliberately inefficient code is elegant, either.
<varjag> it's not deliverately inefficient, i could do it a lot worse if i wanted
<varjag> s/v/b
<shrdlu68> A fiendishly clever person could probably do all this in one format string.
<varjag> not entirely unlikely..
brendarn has joined #lisp
brendyn has quit [Ping timeout: 256 seconds]
<kuribas> shrdlu68: ok, so lisp programmers favour mutable solutions.
<shrdlu68> kuribas: Mutable?
<jdz> kuribas: my version was not mutable at all.
<jdz> For any definition of "mutable".
<shrdlu68> Neither is mine.
<kuribas> jdz: yes write-string and write-char mutate a stream.
<jdz> kuribas: what stream? how can you observe that?
<kuribas> jdz: out
<shrdlu68> jdz: He's referring to with-output-to-string.
<jdz> Also, my version is easy to change so that it writes straight to a stream, without accumulating all the strings which most likely go to a stream afterwards, anyway.
<jdz> kuribas: I recently heard that in Haskell it's also OK to mutate things if they don't escape a function?
<kuribas> jdz: yes
<kuribas> jdz: the type system makes sure it's still pure.
<jdz> Same as with my code.
<shrdlu68> kuribas: Well, then by that definition...
<varjag> my version doesn't mutate anything either
<jdz> I assert that it's pure.
<shrdlu68> I too.
<kuribas> ok then :)
<kuribas> jdz: or you can use unsafe... functions, and assert it yourself.
<jdz> Simple, pure and efficient! All 3.
<shrdlu68> Called with exactly the same set of arguments, the result with always be the same, regardless of any changes outside the function.
<shrdlu68> That, I thought, was the whole point of immutability.
<shrdlu68> There is no way to alter the function's behavior outside of it.
<jdz> shrdlu68: No, bragging about one's favourite compiler is the whole point of immutability.
<varjag> just call your stream monad-stream and you're good
<shka> why you are discussing haskell
<shka> this is common lisp channel
* jdz guilty as charged
<jdz> I was just hoping that making fun of Haskell would be a bit less off-topic.
quazimodo has quit [Ping timeout: 260 seconds]
<hajovonta> safe functions are for pussies
catern has quit [Quit: catern]
<jdz> Right, I also take scissors with me when I go jogging.
quazimodo has joined #lisp
<kuribas> real programmers directly write machine code
<kuribas> is mapcar the same as map 'list ?
<kuribas> just a specialised version of map?
<jdz> kuribas: MAP works on sequences, not just lists.
<LdBeth> shka: monads are not Haskell specific thing. Any languages with proper lambda support can have that
Folkol_ has quit [Ping timeout: 248 seconds]
<shka> LdBeth: i know that
* LdBeth sorry I didn’t read log longer
<LdBeth> A CLOS question, now I have a class which has slots shared across all instances by :allocation :class, but how can I access these slots given I only have name of that class with no instance
<shka> LdBeth: find-class will return instance of class
_cosmonaut_ has joined #lisp
<shka> not sure where exactly value is, but i would start by checking slot definitions
<shka> that are in the class object
<shka> that you can inspect with slime inspector
<shka> does this helps?
<LdBeth> Thanks, now I have some idea to start work with
<_death> class-prototype
jmercouris has joined #lisp
skeuomorf has quit [Ping timeout: 256 seconds]
<shka> makes sense
<flip214> Can anybody remember seeing a high-level interface to the Ethereum Blockchain RPC in CL?
Folkol_ has joined #lisp
Fare has quit [Ping timeout: 240 seconds]
hhdave has joined #lisp
fikka has quit [Ping timeout: 276 seconds]
vhost- has quit [Ping timeout: 260 seconds]
fikka has joined #lisp
doesthiswork has joined #lisp
norfumpit has quit [Ping timeout: 265 seconds]
<Ukari> i found that in some project's file structure, test module are put into /t instead of /test, is it a tradition? for example, https://tinyurl.com/ya7f5w95
scymtym_ has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
scymtym has quit [Read error: Connection reset by peer]
smurfrobot has joined #lisp
Kevslinger has joined #lisp
fikka has joined #lisp
<LdBeth> _death: that’s very helpful, thanks
<LdBeth> Although I believe its not in the standard
<_death> Ukari: think it was a ruby convention
fikka has quit [Ping timeout: 260 seconds]
fikka has joined #lisp
<_death> LdBeth: it's part of the metaobject protocol
skeuomorf has joined #lisp
<kuribas> since we were talking about efficiency... I am disassembling a simple function: (defun f (x y) (+ x (* y 2))) in sbcl. The resulting code doesn't have any add instruction...
<kuribas> I tried adding a declaration: (defun f (x y) (declare (type fixnum x y)) (+ x (* y 2)))
<kuribas> That doesn't seem to improve the code either.
<kuribas> I would think it does a check first on the type, then generates efficient assembly to add the two numbers.
<kuribas> instead it seems to call a generic function +
<scymtym_> kuribas: (* <fixnum> 2) is not a fixnum. try e.g. (declare (type (unsigned-byte 32) x y))
<kuribas> what's 2 then?
<kuribas> scymtym_: right, that gives pretty efficient disassembly.
SenasOzys has quit [Ping timeout: 245 seconds]
<scymtym_> if you want modular arithmetic instead of restricting the argument types, you can do (defun f (x y) (declare (type fixnum x y)) (ldb (byte 32 0) (+ x (* y 2)))) (in SBCL)
<TMA> scymtym_: would that work on 32-bit sbcl, where the fixnums are 31 bit only?
markoong has joined #lisp
aindilis has quit [Read error: Connection reset by peer]
<kuribas> what's the difference between fixnum and unsigned-byte?
<scymtym_> TMA: it would produce the correct result. efficiency would depend on whether the untagged representation was used for the arithmetic, i think
<lieven> fixnums will become bignums on overflow, unsigned-byte will wrap around
<lieven> if you want to assure the compiler that that wont happen you can do (the fixnum (* <fixnum> 2))
knicklux has quit [Quit: Leaving]
jeosol has quit [Ping timeout: 260 seconds]
<kuribas> lieven: I see, thanks
<lieven> kuribas: in optimising settings, a CL compiler will not check your type declarations but will take your word for it. If you lie to the compiler, it will have its revenge.
<kuribas> lieven: so set safety to 1 always?
<jdz> Yes.
<jdz> At least 1.
<lieven> debug 3 speed 0 safety 3 unless locally and you know what you're doing
<_death> my advice is to avoid "fixnum" and explicitly specify the size
<lieven> CPU cycles are cheap, programmer time is expensive
Guest44929 has left #lisp [#lisp]
<kuribas> is speed 3 also unsafe?
kolb has joined #lisp
<jmercouris> lieven: CPU cycles are NOT cheap
<kuribas> sbcl seems to give a type error with speed 3 as well
aindilis has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
<kuribas> and cheap depends on the problem.
<kuribas> if you need 10 instances to do number crunching, then optimizing makes sense.
<jmercouris> kuribas: Agreed!
<jmercouris> I'm just trying to dispel the myth ath CPU cycles are ALWAYS cheap, there is of course times when they are cheap, like during one-off tasks
<kuribas> you can count the cost of requiring more computers - the cost of the programmer optimizing it.
* jackdaniel is ordering 20 CPU cycles (since they have a reasonable price)
<kuribas> jackdaniel: aws works like that
<jdz> Writing generic inefficient code and calling it "programmer efficiency" is snake oil.
<jackdaniel> can I buy 20 CPU cycles from aws? that's really fine-grained :) what if I have a program which is composed only of operations where each takes 3 cycles?
<kuribas> having to choose between safety and efficiency is also something you get when you bargain for using a dynamic language
<jdz> Except when the language in question is CL: we get both.
<jdz> The pinnacle of practicality in programming language design.
<kuribas> jdz: you don't?
<jdz> I don't. I write my code, and it is efficient by design!
<jackdaniel> I don't think the major efficiency and safety gain comes from the language you write in – you can create unsafe and inefficient algorithms in a safe and efficient language
<jdz> jackdaniel: yes, we already discussed Haskell.
<jackdaniel> and I'm inclined to believe, that the reverse is also possible
<kuribas> jdz: so tell me how I get safe and efficient lisp
<jackdaniel> (that is: write safe and efficient programs in unsafe and inefficient language)
<jdz> kuribas: I already gave you an example.
<jackdaniel> kuribas: you simply write safe and efficient code ;-) what lisp gives you is a decent optimizing compiler and runtime safety guarantees
<jdz> kuribas: care to do some benchmarks with your Haskell version?
<kuribas> jdz: sure
<kuribas> jdz: the first problem?
<jdz> Whichever.
<kuribas> I don't know how benchmarks are done in CL though...
<jdz> kuribas: make sure you use the takeWhile, etc. version (i.e., tho generic programmer-cycles saving one).
<jdz> kuribas: easy, you wrap a call in TIME.
<kuribas> jdz: I didn't write that with efficiency in mind. It should be ok anyway.
shangul has quit [Quit: sudo rm -rf /usr/*]
<jackdaniel> are we doing "my language is better" mockup battle? ,p
<jackdaniel> mockup, because it never leads to anything
<jdz> It will definitely lead to strengthen our respective beliefs, no matter the numbers.
<jdz> Because the other party will surely have cheated.
<_death> 1/3 in Haskell...
<jdz> _death: c'mon bruh, we only care about toy examples, not practical real world scenarios.
<jdz> But we still want to see numbers.
<jdz> I'm holding my breath.
fikka has joined #lisp
skeuomorf has quit [Remote host closed the connection]
thawes has quit [Ping timeout: 240 seconds]
skeuomorf has joined #lisp
<kuribas> does sbcl do type inference?
<jdz> Yes.
fikka has quit [Ping timeout: 260 seconds]
<kuribas> so will that omit type checks?
<jdz> If you ask it to.
<jdz> But we already told you not to do SAFETY 0.
<kuribas> no, I mean in safe code
<jdz> Show me safe code, first.
<kuribas> omit type checks by type inference, not by forcing it.
<jdz> I don't want to omit type checks, just the opposite -- I want more type checks!
<jdz> Because my programs change as I develop them.
<jackdaniel> if the type is inferred, then redundant type checks may be safely removed (unless there is a bug in type inference algorithm)
<jdz> And they're running all the time.
Ven`` has joined #lisp
<White_Flame> in other words, type checks internal to a function body migh tbe elided. Those at the interface should remain intact
fikka has joined #lisp
<kuribas> what I mean, is that if you have a function using fixnum, calling another function with fixnum, the typecheck is redundant
<jdz> kuribas: not if one of the functions is changed.
<jdz> It looks like you're wasting programmer-cycles with unimportant details instead of concentrating on a task at hand.
fikka has quit [Ping timeout: 276 seconds]
<jmercouris> jdz: There are nicer ways to speak
<jdz> I'm sorry if that sounds not-nice, that's my actual observation.
<jdz> I trust my programs to be efficient enough if I don't write intentionally inefficient code.
<jdz> Most of the time I really don't bother.
<_death> think about program evolution.. starting a lisp brings up a world at a particular stage of evolution, and you further evolve it by evaluating code.. static languages result in a dead world that's incapable of evolution
<jdz> If there's a tight inner loop I pull out a profiler and see what can be done.
<jmercouris> _death: I've never thought about that
<jmercouris> _death: what are "static" languages? ones without macros?
<jackdaniel> jmercouris: read up on dynamic vs static languages
jkordani has joined #lisp
<jdz> I'd bet introspection and support for re-definition is pre-requisites.
<kuribas> so the lisp code took 0.069 (with no optimizations as recommended), the haskell code 0.009sec
<_death> jmercouris: perhaps a better way to distinguish is system thinking vs. language thinking
<kuribas> haskell code with -O2
<jdz> kuribas: you sure you're comparing apples to apples?
<kuribas> jdz: the same algorithm
<jdz> *sigh*
<jackdaniel> kuribas: then stick to haskell if you plan to write these kind of programs and you really care about efficiency on such level, lisp clearly fails to meet your standards
<jdz> kuribas: care to paste the code (both versions)?
<jackdaniel> discussion -- solved :-)
fikka has joined #lisp
<_death> jmercouris: http://dreamsongs.com/Files/Incommensurability.pdf contains some good discussion about systems vs. languages.. it takes a while to get there though, because the author wrote one essay where he should've written two
<jdz> Right, and write another article titled "Why Common Lisp is not my favourite programming language and why I'm sticking with Haskell".
<jackdaniel> well, these articles kept CL closeish to mainstream for years :p
milanj has quit [Quit: This computer has gone to sleep]
<jackdaniel> if not by practice at least /some/ people heard about it
<jackdaniel> protip: you may put x as a third argument in dotimes, it will be returned by that block
fikka has quit [Ping timeout: 245 seconds]
<jmercouris> _death: I've added to my reading list, thanks
lumm has joined #lisp
<kuribas> feel free to improve the lisp code
<jdz> kuribas: at least add (declare (optimize (speed 3) (safety 1))) to the functions...
<kuribas> jdz: I was just told not to do that
<jdz> Not to do what?
<kuribas> set speed to anything other than 0
<jdz> You were told not to do SAFETY 0, but SAFETY 1.
<jdz> There's a difference between SPEED and SAFETY.
<jdz> And you were told to never set SAFETY to 0, not SPEED.
<jackdaniel> kuribas: may I ask a question: do you plan to learn lisp, or your goal is to compare it to haskell?
<kuribas> <lieven> debug 3 speed 0 safety 3 unless locally and you know what you're doing
<kuribas>
<kuribas> jackdaniel: both
<jmercouris> jackdaniel: may I ask a question: why do people preface questions with questions in this manner?
<kuribas> but I'll stop annoying you guys with it
EvW has joined #lisp
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jackdaniel> imo you can't do both *at the same time*, because these are two different languages with different promises
<jdz> kuribas: you might as well think what you're doing. Why not set -O0 -g for haskell version?
<jackdaniel> for instance (I don't know haskell, so I may be wrong here) – if haskell is functional, then it can memoize function call results
<kuribas> the thing is, I don't find giving up safety for performance a good option.
<jdz> Not that it would change anything, but still... comparing apples to apples...
<jackdaniel> in Common Lisp you'd have to create your own defmemo macro for that to achieve similar result
<jdz> kuribas: that's why we tell you to never declare SAFETY 0.
<jackdaniel> jmercouris: how can I answer? that's how I speak sometimes? should I really explain myself on this matter?
fikka has joined #lisp
<jmercouris> jackdaniel: I was making an observation that I thought you might be interested in reflecting on
<jackdaniel> I've noticed only a question, not an observation
xificurC has joined #lisp
<jmercouris> It was a socratic observation ;)
<jackdaniel> sorry socrates, I don't get you
<kuribas> jdz: I am getting the same performance with speed 3, but maybe i am doing something wrong.
jason_m has joined #lisp
<jmercouris> jackdaniel: https://en.wikipedia.org/wiki/Socratic_questioning - last post on the matter, as it is off,topic
attila_lendvai has joined #lisp
shifty has joined #lisp
<jackdaniel> I know what is a socratic question, I just fail to recognize it in yours :)
thawes has joined #lisp
<varjag> kuribas: lisp optimization declaration is a vector
<varjag> speed 3 alone isn't very precise
<varjag> depends on other settings too
<shrdlu68> kuribas: Could you paste the code you're comparing?
<kuribas> shrdlu68: I did
<shrdlu68> kuribas: The biggest optimization, in my experience, is usually in type declarations.
<jdz> kuribas: also, you don't have a declaration for the X variable in G.
<jdz> But you have one in the Haskell version.
Ven`` has joined #lisp
housel has quit [Remote host closed the connection]
<kuribas> ah right
housel has joined #lisp
<jdz> Also, this exercise is really silly, nothing to do with the ADD-TEXT-PADDING we discussed earlier.
<jdz> About writing intentionally inefficient code in the name of saving programmer-cycles.
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
<kuribas> jdz: doesn't significantly reduce the runtime performance
<shrdlu68> kuribas: Inline #'f
<kuribas> shrdlu68: in the declare?
schweers has joined #lisp
<shrdlu68> (declare (inline f)) just before the defun
<varjag> 0.014 sec for me
<varjag> don't have haskell here tho
<jdz> I thought the point of the exercise was not to try and optimize a trivial piece of code, but to compare the speed of idiomatically written code...
<jdz> Still don't see any sign of takeWhile here...
<shrdlu68> kuribas: You haven't declared the types of x, y, n in #'g
<jdz> kuribas: also, what's the result of g 1000000 in your Haskell version?
<kuribas> jdz: about 2ms
<jdz> No, not the time, the result.
SenasOzys has joined #lisp
<jdz> And then tell me more about safety.
<jackdaniel> surely result is 42
Fare has joined #lisp
<varjag> shrdlu68: declaring #'f inline takes it to 0.003 seconds
<jackdaniel> because it is the answer
<kuribas> jdz: 1500000500000
<jdz> Considering you've translated the code correctly, and Int in Haskell is 32-bit signed integer.
<kuribas> varjag: can I see the code please?
pbgc has joined #lisp
<varjag> kuribas: just (declaim (inline f)) globally
<varjag> the other optimizations don't do much
<varjag> well declaring speed/safety will shave you a millisecond or two
<jdz> Next step of the exercise is to measure the time it takes to compute a value that exceeds Haskells Int type.
<jdz> Common Lisp will happily and safely oblige, what will Haskell do?
<kuribas> with 100000000 I get about 0.200s for sbcl, 0.70s for ghc.
<kuribas> jdz: what do you mean?
<kuribas> jdz: I understood that (unsigned-int 32) will just wrap around.
<jdz> kuribas: change the result of F to be (+ x (* y 1024 1024 1024)).
<jdz> I.e., instead of multiplying by 2, multiply by 1024^3.
<varjag> if you change the u32 typedecl to NUMBER in #'f, it'll likely speed up
<shrdlu68> Or to fixnum.
milanj has joined #lisp
<jdz> What's the point?
<kuribas> anyway, thanks for the help everyone
<jdz> Haha.
<shrdlu68> kuribas: What have you learnt?
<jdz> kuribas: I'd still like to know what the result with my proposed change for the Haskell version is.
<kuribas> shrdlu68: that you can use declaration to improve the performance of lisp code
<jdz> In CL it is 536871449370911500000.
<kuribas> jdz: feel free to try it out :)
<jdz> Calculated in sub-second.
<jdz> I don't have Haskell around.
<jdz> Why would I want if it can't compute such simple functions?
<jdz> Safely.
<shrdlu68> kuribas: Indeed. But you don't have to, until speed really matters. It won't get in your way screaming for declarations and types.
<kuribas> shrdlu68: I am going to work on a codebase involving lots of data, were performance does matter.
<jdz> kuribas: do correct results also matter?
<kuribas> jdz: absolutely
<jdz> If yes, may I suggest using Common Lisp instead of Haskell?
EvW has quit [Ping timeout: 245 seconds]
<kuribas> jdz: you may
<jdz> Because as we just witnessed, Haskell clearly comes short in this departament.
<shrdlu68> kuribas: Good, write the code as you would naturally, with optimal data structures and algorithms, _then_ add declarations.
<kuribas> shrdlu68: the code is already written...
<jmercouris> kuribas: rewrite it in rust
<White_Flame> rewrite in assembly
<jmercouris> I'm joking of course
<varjag> swift
<jdz> I've heard Rust is faster than C.
<White_Flame> or heck, if it's heavily math-oriented, go all GPU on it
<varjag> it's like haskell but with better syntax
<kuribas> White_Flame: yeah, that would be cool
<kuribas> White_Flame: but not all problems map well to the GPU
<jdz> Change the problem.
<jmercouris> jdz: If you reframe any problem enough times, I belive you'll always end up where you started: rewrite it in rust
<kuribas> White_Flame: for example, simple averaging numbers is faster on the CPU, because you don't have the latency of transferring to the GPU.
runixy has joined #lisp
<jdz> I bet Haskell is good enough, 64-bits should be enough for everyone.
<xificurC> is this still #lisp?
<jdz> xificurC: no, this is #haskel-bashing
<jackdaniel> xificurC: I have my doubts, but not sure who should take a kick, it seems like a rebellion ;-)
<jackdaniel> I guess I'll pretend I'm not around ;p
<jdz> We just proved the superiority of Common Lisp over Haskell, surely we can have a little afterparty, right?
<varjag> jdz: i tried running his haskell code in online repl, it dies with out-of-memory
<jackdaniel> I wasn't convinced by these "proofs" to be honest
<xificurC> sure, in #lispafterparty
<jackdaniel> especially that the metodology was flawed
<xificurC> there was methodology?
<jmercouris> we cannot compare the "speed" of two languages
<shrdlu68> There has been a renewed interest in comparing languages recently, what with all the new languages being invented, and all the propaganda being thrown around.
<jmercouris> we can only compare the specific implementation of a problem in language A and language B
<jdz> It never was a bout speed, guys, but about safety.
<jmercouris> sometimes A may be faster than B, and vice versa
<White_Flame> shrdlu68: and greenspun's rule still reigns
<jackdaniel> there is no such thing as language speed. quality of produced code may be measured, or at the very last – language "optimization"-friendliness
<jmercouris> jackdaniel: YES! Thank you! this is what I was trying to get at the other day
<jmercouris> Nobody could understand what I was trying to say though
smurfrobot has quit [Remote host closed the connection]
<shrdlu68> beach has been saying that for a long time.
<jmercouris> Yes
<jmercouris> I was even having a conversation with beach at the time where I could not explain it to him
<jmercouris> even though he is the one who introduced this idea to me
<jdz> This what it was all about: <kuribas> the thing is, I don't find giving up safety for performance a good option.
smurfrobot has joined #lisp
<jdz> He was having Haskell in mind, but it turned out to be the other way around.
<jmercouris> it wasn't for a lack of his comprehension or anything, I just couldn't put the thoughts into words, in that context
Fare has quit [Ping timeout: 260 seconds]
EvW1 has joined #lisp
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
Kevslinger has quit [Quit: Connection closed for inactivity]
<_death> typical development in lisp is working with a living system.. you define stuff, test in the repl, redefine, inspect objects, etc. typical development in haskell is write, compile, rinse, repeat.. each time setup the whole thing from scratch
LiamH has joined #lisp
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<_death> or is there someone using ghci for actual development?..
<White_Flame> and lisp refactoring teaches you to keep your abstractions well-defined so you can adjust things later. I wonder how difficult it is to refactor the types in a haskell program
<jdz> It's easy: just fix all the places where compiler complains.
<White_Flame> though likely a similar style exists, to keep it more adjustable
knicklux has joined #lisp
jmercouris has quit [Ping timeout: 256 seconds]
Bronsa has joined #lisp
Fare has joined #lisp
terpri has quit [Ping timeout: 264 seconds]
thawes has quit [Remote host closed the connection]
jason_m has quit [Ping timeout: 260 seconds]
sbwhitecap has joined #lisp
<runixy> Can I specify some constraints on the type of the parameters for a function, such as informing the compiler that the parameters are NUMBER? See lines 75 to 113 (including error message) on https://paste.ofcode.org/yzZkqCsTshQZtJ5gKwKddM as I would like to avoid having to use the macro for defining the function.
<beach> runixy: Yes.
<beach> clhs declare
<beach> runixy: I am not sure I understand what you are trying to do and I am not sure I understand why wall-builder-not-working is not working.
<beach> runixy: Let's see...
<beach> runixy: You are calling the macro BUILD-CONSTRAINTS, passing it four symbols.
<xificurC> also pretty sure the paste doesn't include the actual call that errored out
<xificurC> i.e. what was typed into sly
<runixy> yes, and then I don't understand why I/we would have to make a macro to build the wall-builder function
ymdatta has joined #lisp
<beach> runixy: Then in BUILD-CONSTRAINTS you try to subtract 1 from wall-height.
<beach> I.e., you are trying to subtract 1 from a symbol.
<runixy> ye
<xificurC> runixy: please show what did you type into the REPL (sly)
<runixy> I'm not sure how to properly declare rows a number
<xificurC> or did the function not compile
Kundry_W_ has joined #lisp
<xificurC> you don't have to declare anything
<beach> runixy: Declaring it won't work.
<xificurC> you just passed it something else than a number at some spot
makomo has joined #lisp
<beach> runixy: If you declared it to be a number you would lie to the compiler, because you are passing a symbol, not a number.
<runixy> I'm just loading the file with c-k c-l
Kundry___ has joined #lisp
<beach> runixy: What is build-constraints supposed to do?
<beach> Does it have side effects?
<runixy> and my file is what I pasted.
<beach> runixy: There seem to be many problems with your code.
Kundry_W_ has quit [Read error: Connection reset by peer]
<beach> runixy: Can you please tell us whether build-constraints is supposed to have any side effects. It looks to me like it is just supposed to return some code. Right?
<runixy> ye, just returning code
<beach> runixy: So in (progn (build-constraints ...) ...)
<runixy> because the code has to be executed in a proper screamer context
<beach> You thow that code away.
<beach> throw.
shangul has joined #lisp
<beach> runixy: Do you know how PROGN works?
<beach> clhs progn
<runixy> ye, evaluates the form one by one
<beach> And then returns the value of the last one.
<beach> Discarding the values of the others.
<beach> So if BUILD-CONSTRAINTS returns something useful without having any side effects, in this context, the useful thing is thrown away.
<xificurC> beach: build-constraints returns (progn (setf ...) (setf ...)) as seen from his paste
warweasle has joined #lisp
<xificurC> beach: so actually all it does is side effects
<xificurC> he is going through the blog post I linked and trying out the pieces
<beach> xificurC: If the returned code where to be evaluated, yes.
<runixy> it is collecting the terms/forms, so it should return them all
<xificurC> beach: well it's a macro that returns code, why would it not get evaluated?
<runixy> ye, and then I don't understand why he had to wrap the wall-builder function in a macro
<beach> xificurC: Right, my bad. I misunderstood the code.
<runixy> the macros are used to provide forms that are being evaluated in wall-builder-builder
<xificurC> runixy: this is explained in the blog post. The guy writes out a function for 2x2 and one for 3x3. Then he proceeds to write a macro which takes the dimensions as parameters and produces the boilerplate code automatically
EvW1 has quit [Ping timeout: 255 seconds]
Bike has joined #lisp
jmercouris has joined #lisp
<xificurC> runixy: what might be tripping you is that the macro always generates (defun wall-builder ...) which isn't really correct. It should generate a different function for each input, e.g. wall-builder-2x2, wall-builder-4x20, ... The author just didn't bother to write this out explicitly
<runixy> ye, but couldn't wall-builder be a function taking in the parameters directly (if I could specify types)
<beach> runixy: I think you will understand if you macroexpand the call to wall-builder-builder.
<xificurC> runixy: it's not about types, forget types. It's about having a solver for a 2x2 grid, a solver for a 20x20 grid, whatever one wants
skapata has joined #lisp
Kundry___ has quit []
<xificurC> runixy: he wrote out the 3x3 case, did you see how much more boilerplate code that was? Now he wrote a macro so if he needs a 4x4 solver the macro will generate a solver for it. It should be named wall-builder-4x4 though, not overwriting any previous wall-builder
<runixy> I have to redefine wall-builder (by using wall-builder-builder) for different parameters, but I was curious if that can be circumvented and just define a function that then evaluates the other macros at run-time.
eli_oat has joined #lisp
<makomo> i'm gonna guess, is this chris kohlhepp's blog?
<xificurC> makomo: yes, I linked it a while ago
<makomo> awww yeah
<beach> runixy: If you did that, you would see that the BUILD-CONSTRAINTS form has numbers in it.
<makomo> those posts are awesome :-D
<makomo> i've read them awhile back. i really like his stuff
<beach> runixy: It can't be done because the function would work at run time.
<xificurC> runixy: macros like build-constraints are *not* evaluated at runtime in your case
<beach> runixy: Whereas the macro works at compile time.
<runixy> I don't get why doing a macro to define a function is able to look past type issues, when just defining the function is not? I guess that is my real question
<beach> runixy: Did you macroexpand?
<beach> runixy: (macroexpand-1 '(wall-builder-builder :wall-height ....))
<runixy> no, I will look into that - went the type declaration way instead
<beach> runixy: If you do that, what do you see in the call to build-constraints?
eli_oat has quit [Client Quit]
<beach> If you declare the type to be number, then you will like to the compiler because you are passing it symbols, not numbers.
jack_rabbit has quit [Ping timeout: 264 seconds]
<beach> lie to the compiler.
<beach> Not like
<beach> runixy: Could you please do the macro expansion? I think then you would understand.
<xificurC> runixy: I think you need to look into how macros work and when they are expanded
Cymew has quit [Remote host closed the connection]
<xificurC> how does one evaluate code here in IRC?
<beach> One doesn't.
<xificurC> :(
Cymew has joined #lisp
Patzy has quit [Quit: WeeChat 2.1]
Patzy has joined #lisp
<xificurC> (defmacro add-one (x) `(+ ,x 1)) (let ((n 1)) (add-one n)) . this is a simplified version of his issue, correct beach?
crayonwitch has joined #lisp
<beach> That one works.
<makomo> how did he call wall-builder-not-working?
attila_lendvai has quit [Quit: Leaving.]
<beach> makomo: It won't matter because it won't compile.
<beach> makomo: When the compiler sees the call to build-constraints, it will macroexpand it.
<makomo> oh mhm, i have to read the whole thing
<beach> makomo: And the arguments to that call are symbols.
<beach> Whereas the macro build-constraints expects numbers.
<makomo> yup, so the numbers have to be constants right?
Cymew has quit [Ping timeout: 260 seconds]
<xificurC> beach: my bad
<beach> makomo: Macros don't evaluate their parameters, so you can't pass it a symbol expecting its value to be used.
<makomo> beach: yes, of course. which means that the macro expects to work with constants, correct?
mindCrime has joined #lisp
<makomo> since its using the numbers at macroexpansion-time
<makomo> it's*
<beach> makomo: That's not the right terminology. It expects its parameters to be numbers.
<makomo> i mean, constant numbers :-D
<makomo> the two properties are orthogonal, right?
<beach> Literal numbers would be right, I think.
<makomo> ah
Guest39038 has quit [Remote host closed the connection]
<makomo> beach: remember our talk yesterday about &rest in defgeneric and &key in defmethod?
<makomo> clhs 7.6.4
<specbot> Congruent Lambda-lists for all Methods of a Generic Function: http://www.lispworks.com/reference/HyperSpec/Body/07_fd.htm
<beach> xificurC: More like (defmacro add-one (x) (1+ x)) and then the difference between (add-one 234) and (let ((n 234)) (add-one n))
<beach> makomo: Yes.
<makomo> the sentence we found, isn't it only applicable when case 4 is active?
<makomo> specifically the last sentence of case 4
<makomo> since my defgeneric has no &key parameters, why would case 4 be applicable at all
<xificurC> beach: yes, using the value at compile time
<beach> makomo: I guess I missed that.
<makomo> yup, same. so then what would be the reason for the method accept invalid keyword arguments?
<makomo> accepting*
<beach> makomo: No wait...
<beach> makomo: Your defgeneric had &rest but not &key?
mindCrime has quit [Ping timeout: 240 seconds]
<makomo> yes, it's weird, but i'm only testing corner cases
<makomo> i mean, i don't know whether to interpret that last sentence in case 4 as something that's applicable only when case 4 applies, or as a general fact (with or without case 4)
<beach> Oh, yes, I see.
<makomo> so i have (defgeneric hello (a b &rest c)) and (defmethod hello (a b &key c)). then i call (hello 1 2 :d 100)
<beach> I think case 4 is all about &key being mentioned in the generic function lambda list.
<makomo> no error is signalled for the invalid keyword "d"
<beach> Right.
<makomo> mhm, that's what i would think too
<xificurC> runixy: try (defmacro what-am-i-at-compile-time (x) (format t "type ~a with value ~a~%" (type-of x) x)) and then (what-am-i-at-compile-time 100) and (let ((x 100)) (what-am-i-at-compile-time x))
<xificurC> and finally (what-am-i-at-compile-time x)
<beach> makomo: Do we know that an implementation is obliged to signal an error in such a situation?
<makomo> beach: not quite :-)
<makomo> haven't found it anywhere
<makomo> but i also haven't found anything saying that it's legal either
<makomo> and besides, a normal function would signal an error for that
<beach> clhs 3.5.1.4
<specbot> Unrecognized Keyword Arguments: http://www.lispworks.com/reference/HyperSpec/Body/03_ead.htm
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
<makomo> hmm, i don't see anything new
<beach> Yeah and I think that section is wrong actually.
<makomo> oh?
<beach> (defun f (&rest x) x)
<beach> (f :hello 234)
flamebeard has quit []
<beach> According to 3.5.1.4, it should signal an error.
<beach> makomo: Anyway, are you using SBCL?
<makomo> beach: hmm, but are those even treated as keyword arguments in that case?
<makomo> since you didn't specify &key
<beach> Yeah, OK. Good point.
<makomo> beach: i'm using sbcl, but i'm trying to figure out the standard behavior
<beach> I was going to suggest asking the maintainers of SBCL.
mangul has joined #lisp
<beach> They are usually very knowledgeable when it comes to the standard.
<makomo> ah, i guess that's not a bad idea
pierpal has quit [Ping timeout: 248 seconds]
shangul has quit [Ping timeout: 264 seconds]
mangul is now known as shangul
lel has quit [K-Lined]
knicklux has quit [Ping timeout: 276 seconds]
pierpal has joined #lisp
eli_oat has joined #lisp
crayonwitch has quit [Ping timeout: 256 seconds]
pierpal has quit [Ping timeout: 260 seconds]
pierpal has joined #lisp
eli_oat has quit [Quit: Leaving.]
daniel-s_ has quit [Remote host closed the connection]
karswell has quit [Ping timeout: 256 seconds]
sjl_ has joined #lisp
Inline has joined #lisp
<_death> makomo: the generic function takes any arguments (&rest), so there's no mismatch..
<beach> _death: Can you point to the relevant Common Lisp HyperSpec section that supports that claim?
<makomo> _death: ^ :-)
<_death> what claim exactly
<makomo> _death: the fact that the method isn't required to do any checking of its own
<makomo> i.e. that the checking from the generic function is enough for the call
<beach> That if the generic function lambda list mentions &rest but not &key, then there is never any argument mismatch, even when a key is passed to a method that does not accept it.
<_death> the gf's and method's lambda list are congruent (rule 3)
<_death> the method is applicable given the call shown
<_death> the gf doesn't specify &key, but &rest
<makomo> and why doesn't the method signal an error for passing an invalid keyword?
<makomo> if the answer is "because only the generic function checks the argument list, not the methods", then where is this said in the standard?
<_death> who says there is an invalid keyword passed to it?
<makomo> well that was my original question :-)
<_death> the generic function takes &rest, so there are no keywords
<makomo> (defgeneric test (a b &rest c)) (defmethod test (a b &key c)) (test 1 2 :d 100)
<makomo> this is valid, why? the method clearly takes only the keyword argument :c. why is :d allowed?
<_death> :d is allowed because you're not calling a method
<_death> you are calling a generic function.. which takes a &rest parameter
<makomo> i.e. you're calling the generic function, and only it does the validation of the arguments
<makomo> right, but where is this specified in the standard?
<makomo> the fact that only the generic function does validation
<warweasle> Is there a library for persistent amortizing?
<_death> there is no validation (of keyword arguments) here
<_death> if it took &key, then there'd be validation.. perhaps also when the method is called
<beach> No.
<Inline> c = :c = (:d 100) ?
SenasOzys has quit [Ping timeout: 265 seconds]
<beach> _death: That case is clearly specified not to signal an error.
<makomo> afk, i'll be back later in the day and i'll read the logs
<beach> _death: Like makomo, I don't buy your argument. You may be right, of course, but I don't see it.
<beach> Inline: Is there a question there?
<Inline> no
oni-on-ion has quit [Ping timeout: 240 seconds]
<Inline> beach: i have an offline question related to wxmaxima, maxima therein is loosing it's socket somehow, when i start maxima from the console everything works as expected....
<beach> Maybe you should try Climaxima instead.
papachan has joined #lisp
_cosmonaut_ has quit [Ping timeout: 256 seconds]
makomo has quit [Ping timeout: 255 seconds]
_cosmonaut_ has joined #lisp
mindCrime has joined #lisp
smurfrobot has quit [Remote host closed the connection]
Fare has quit [Ping timeout: 256 seconds]
karlosz has joined #lisp
nika_ has joined #lisp
smurfrobot has joined #lisp
jmercouris has quit [Ping timeout: 264 seconds]
sjl_ is now known as sjl
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
<Inline> welp, i suppose i have to git pull it all again....
slyrus has joined #lisp
eli_oat has joined #lisp
rippa has joined #lisp
terpri has joined #lisp
<jackdaniel> I don't remember details, but we were troubleshooting this problem with someone using maxima
karlosz has quit [Remote host closed the connection]
<jackdaniel> let me see in the ecl's closed issues (it wasn't ecl's issue after all I think)
jmercouris has joined #lisp
<jackdaniel> see last comment of the second one, maybe it will be helpful
surya has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
trn has quit [Remote host closed the connection]
trn has joined #lisp
Arcaelyx_ has joined #lisp
paul0 has quit [Quit: Leaving]
fikka has quit [Ping timeout: 256 seconds]
smurfrobot has quit [Remote host closed the connection]
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
karlosz has joined #lisp
surya has quit [Remote host closed the connection]
cgay_ has quit [Ping timeout: 256 seconds]
robotoad has joined #lisp
low_brain_cache has joined #lisp
surya has joined #lisp
fikka has joined #lisp
nickenchuggets has joined #lisp
nickenchuggets has quit [Changing host]
nickenchuggets has joined #lisp
Fare has joined #lisp
Kaisyu has quit [Quit: Connection closed for inactivity]
eli_oat has quit [Quit: Leaving.]
fikka has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
oni-on-ion has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
EvW has joined #lisp
smurfrobot has joined #lisp
hajovonta has quit [Remote host closed the connection]
fikka has joined #lisp
puchacz has joined #lisp
eli_oat has joined #lisp
<puchacz> hi, how to correctly read an unknown XML from file pls? the first problem is that it can have unknown encoding, and I think usually the header says something like: <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<puchacz> in which case I should use :utf-8
fikka has quit [Ping timeout: 256 seconds]
karlosz has quit [Ping timeout: 256 seconds]
<puchacz> maybe this one handles nuances like this: (cxml:parse-file "example.xml" (cxml-dom:make-dom-builder))
sendai_ has joined #lisp
fikka has joined #lisp
karlosz has joined #lisp
zaquest has joined #lisp
karswell has joined #lisp
azimut has quit [Ping timeout: 240 seconds]
flazh has quit [Ping timeout: 265 seconds]
runixy has quit [Ping timeout: 260 seconds]
low_brain_cache has quit []
fikka has quit [Ping timeout: 256 seconds]
catern has joined #lisp
catern has quit [Excess Flood]
catern has joined #lisp
catern has quit [Excess Flood]
catern has joined #lisp
catern has quit [Excess Flood]
catern has joined #lisp
catern has quit [Excess Flood]
catern has joined #lisp
catern has quit [Excess Flood]
catern has joined #lisp
catern has quit [Excess Flood]
flazh has joined #lisp
fikka has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
kpenc has joined #lisp
kpenc has left #lisp [#lisp]
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
ymdatta has quit [Ping timeout: 248 seconds]
fikka has joined #lisp
mercourisj has joined #lisp
lel has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
jmercouris has quit [Ping timeout: 256 seconds]
shrdlu68 has quit [Ping timeout: 260 seconds]
SenasOzys has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
varjagg has joined #lisp
FreeBirdLjj has joined #lisp
pjb has joined #lisp
fikka has joined #lisp
<pjb> Ukari: actually, the way to write local constants, is to write literals. Ie. anything that's quoted or self-evaluating is for all intents and purposes the same as a constant variable defined with defconstant.
eli_oat has quit [Quit: Leaving.]
mflem has joined #lisp
<pjb> Ukari: the only meaning of defconstant is that the compiler is allowed to inline (possibly multiple copies) of the value. It doesn't mean that the object is immutable per se (but it should be considered immutable, because if you try to mutate it, you can get starnge results, such as crashes, nasal daemons, or only one copy being mutated!
<pjb> Which is exactly the same with quoted literals and other self-evaluating literals!
fikka has quit [Ping timeout: 245 seconds]
orivej has joined #lisp
m00natic has quit [Remote host closed the connection]
hhdave has quit [Ping timeout: 240 seconds]
nickenchuggets has quit [Read error: Connection reset by peer]
nickenchuggets has joined #lisp
nickenchuggets has joined #lisp
nickenchuggets has quit [Changing host]
<Ukari> how to use literals as a immutable let ?
fikka has joined #lisp
<pjb> Ukari: (+ 48 4) instead of (let ((zero 48)) (+ zero 4))
<pjb> Ukari: also, notice how in (let ((zero 48)) (+ zero 4)) it doesn't matter whether zero is a constant variable or not: we can see it LEXICALLY that we are not mutating the bingin, and the compiler knows it too, so it can eliminate the variable and inline the value.
<pjb> and they do this!
schweers has quit [Remote host closed the connection]
<pjb> Try it: (declaim (optimize (space 3) (speed 3))) (disassemble (compile nil (lambda (d) (let ((zero 48)) (+ zero d)))))
<Ukari> if use a (funcall return-48) instead of 48, literals way can't use (funcall return-48)'s value twice if I don't wan't funcall return-48 twice
<pjb> Then it's not a literal.
<Ukari> well..
<pjb> I mean, it cannot be bound to a constant variables.
fraya has joined #lisp
<pjb> Constant variable values must be known at compilation time, so they may be inlined by the compiler.
fikka has quit [Ping timeout: 240 seconds]
<pjb> Ukari: Look, the point is that defconstant is a very strange and very specific operator that just doesn't do what you think it does.
<pjb> Already, the name "constant VARIABLES" should give you a hint you're in Alice Wonderland territory.
<Bike> i think ukari was using amore lay meaning of constant as "not modifiable"
<pjb> Ukari: so lexically, things are know at compilation time, or they don't qualify for "lexical".
<Bike> including for example values that don't exist at compile time
<Bike> so the annotation as "constant" would just forbid setf and such.
<pjb> the value returned by (function return-42) is not a lexical value, because it cannot be known by the compiler.
<pjb> (unless some very specific cases, but few CL compilers implement the global analysis that would allow them to know).
<pjb> Ukari: perhaps you would want to consider a macro or a compiler-macro to deal with those forms, instead of just a binding?
<Ukari> maybe it is a mistake for me to use defconstant as a compare target to what i need, what i need is not literal constant because it can't assign to some stuff in runtime
<Ukari> what i need is a immutable let, it could assign once, assign to some stuff in the runtime, then it couldn't change anymore
<pjb> Ukari: you're wrong.
<pjb> LET is a lexical binding operator. It doesn't work in time. It works in space.
<pjb> Haven't you studied relativity in school?
<pjb> What do people learn nowadays?
<pjb> There no "anymore" in the lexical scope.
<pjb> There are inside or outside of the scope.
<Bike> i don't think it's hard to imagine a let binding that would have setqs of the variable to be a compiler warning or error, regardless of one's understanding of physics.
defaultxr has joined #lisp
<pjb> Either you write a assignment inside the scope, or you don't. And this is written textually, in space, so it is known of all eternity whether you did it or not.
karlosz has quit [Ping timeout: 268 seconds]
mareskeg has joined #lisp
<pjb> Bike: sure, but then you want to change the compiler. As a user, you can do that with writing your own IMMUTABLE-LET macro and do the code walking to check.
<pjb> As I said above, you should consider a macro.
fikka has joined #lisp
eli_oat has joined #lisp
<Ukari> though let is analysis by compile in space, but the assignment between stuff to it is actually happens in runtime
<pierpal> or just use a symbol-macrolet
brendarn has quit [Ping timeout: 264 seconds]
mareskeg has quit [Client Quit]
<pierpal> ukary: no. it happens in space. that's the point of lexical vs dynamic
FreeBirdLjj has quit [Remote host closed the connection]
<Ukari> no, (let ((x 3))), you won't know the value 3 what x assigns to in compile time
<Ukari> how could you know that, impossible
karlosz has joined #lisp
Bronsa has quit [Ping timeout: 264 seconds]
<Bike> well, in that particular case 3 is a literal, so it's actually pretty obvious.
_cosmonaut_ has quit [Ping timeout: 256 seconds]
FreeBirdLjj has joined #lisp
<phoe> you won't know, but the compiler knows
<mfiano> I think you'll be fascinated by how compilers work when you understand the basics.
fikka has quit [Ping timeout: 248 seconds]
<phoe> it's the compiler's duty to turn that information into something useful, not yours
<pjb> Ukari: You can do something like: https://pastebin.com/RALN9tye
<Ukari> the compiler knows the reference or address or pointer, but not know the value store in address
<pjb> This gives you a run-time check. Perhaps sbcl could also validate it at compilation time.
<Bike> yeah it does. it's 3
<beach> Ukari: In this case, the compiler "knows" that the value of the variable is 3.
<pierpal> uh?
<beach> Ukari: What makes you think that the compiler does not keep this information?
<Ukari> because it is not a compiler's duty
<_death> there may not even be an address..
<beach> Ukari: I suggest you read the book by Steven Muchnick.
makomo has joined #lisp
<beach> Ukari: There is, for example, a compiler optimization technique called "constant propagation" that takes this information and replaces all references to the variable by the literal.
smurfrobot has quit [Remote host closed the connection]
skeuomorf has left #lisp ["Killed buffer"]
<beach> Speaking of which, I have always claimed that even application programmers should know about compiler design. I have seen so many application programmers write silly code because they have an incorrect model of what the compiler does.
<Bike> memories of C...
nickenchuggets has quit [Read error: Connection reset by peer]
<Bike> at least some basics.
nickenchuggets has joined #lisp
nickenchuggets has joined #lisp
nickenchuggets has quit [Changing host]
<Bike> though "the compiler never knows about or does any optimizations ever" is a new attitude for me
<Bike> i think forth is like that sometimes...?
<beach> Ukari: So what is the duty of the compiler according to you?
<Ukari> If i remember correctly, in python, if there is a array a = [1, 2, 3, 3]. use id(a[2]) and id(a[3]), you could find it returns a same address where stores the only one 3
<makomo> beach: i agree. in general, regarding usage of any interface, i think that programmers should be aware of how the underlying implementation works, or at least have an idea how it works
<mfiano> arrays in python are linked lists, for starters
attila_lendvai has joined #lisp
<makomo> beach: for me, using an abstraction shouldn't mean that you're ignorant about the details. it should mean that you half-know how it works, but don't assume anything, i.e. you're intentionally avoiding relying on anything that's implementation-defined
<mfiano> and now we're back to constant folding literals in lisp
<beach> mfiano: Not even trees? Wow!
<Ukari> mfiano, you didn't understand what i want to say in my example
<makomo> i don't know if that makes sense, but there's a subtle difference in there for me
<Bike> You want to say that the two array elements are aliased?
<makomo> which i think is essential
smurfrobot has joined #lisp
<makomo> and makes you a better programmer in the end
<Bike> fuck, id is an address-of function. that's a weird builtin for a language like python to have
<beach> makomo: I think I understand. The "silly code" I was referring to typically avoided abstractions because of some idea that the compiler would generate slower code then.
<Ukari> 3 could be a reference which actually reffer to a address where stores 3
<Bike> Sure?
<Bike> The value's still going to be 3 though.
<Ukari> if you change the value in the address in runtime, it won't be 3 in runtime
<beach> Ukari: I am still interested in what the duty of the compiler is according to you?
<makomo> beach: ah i see. i guess it's not directly related, but i think it's an interesting thought/approach anyway
<Bike> whether it's a reference or whatever doesn't matter to the basic semantics.
<drdo> You don't understand what's going on, so don't even bother
<drdo> Write the nice code and profile if needed
<drdo> It's not only the compiler you have to worry about, there's a whole tower of stuff
Fare has quit [Ping timeout: 240 seconds]
<makomo> mfiano: are they really linked lists? i don't think so
<makomo> aren't python's arrays just "dynamic arrays", i.e. like C++'s std::vector
<Bike> is it relevant?
<makomo> or CL's adjustable arrays/vectors
<Ukari> in let example, complier gives address and no need to know what stores in address because what stores in address is not sure in runtime
fikka has joined #lisp
karlosz has quit [Read error: Connection reset by peer]
<Bike> Ukari: Lisp doesn't have some weird semantics where you can redefine what 3 is at runtime. if you write (let ((x 3)) ...) x will be 3, as is intuitively obvious.
<beach> Ukari: You definitely need to read up on compiler technology.
karlosz has joined #lisp
<pierpal> even just using common sense would work too
<mfiano> I'm sorry for spreading misinformation...I was completely wrong. It's lists that are implemented as arrays, rather than linked lists.
<beach> I am intrigued by this idea that the compiler should not optimize code even if it can because it is not its "duty".
<Ukari> well, Bike, but the optimization technique trick only happens in some case can't prove that all stuff's value which assign by let are certein in compile time
<Ukari> are known in compile time
<drdo> beach: Why is that even a reasonable idea?
<beach> drdo: It isn't, according to me. But Ukari seems to think it is.
fikka has quit [Ping timeout: 240 seconds]
<jackdaniel> it could be certainly useful for testing (being able to disable certain optimizations, so you can for instance examine output with only one optimization being active), but it is a different story
<beach> Very different, yes.
<makomo> mfiano: yup, and i hate the terminology
<makomo> half of everything in this world would be much easier if people just used consistent and proper terminology
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
<jackdaniel> new ideas emerge from chaos, made-up terminology may spawn new ideas (by triggering metaphores) etc, don't discard the brilliance of mistakes
<makomo> jackdaniel: good point i guess
<pierpal> ok. I'm convinced. Let's start calling vectors lists! :)
shifty has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
<jackdaniel> I'm afraid you mistake mistakes with jokes ;-)
<makomo> noooo :D
<jackdaniel> and not knowing terminology with purposefuly skewing it ;p
<makomo> in fact, alex stepanov, the designer of C++'s STL, named std::vector after CL's vector
<makomo> he said that's one of the decisions he regrets
<makomo> because it clashes with the notion of "vector" from mathematics
<pjb> Bike: (setf *read-base* 2.) (defvar 3 101010) (* 3 10) --> 84
<Bike> Ukari: the compiler can often prove a lot.
<Bike> pjb there is no point in telling me this and you know it.
<Bike> it's obviously completely irrelevant to the actual point being discussed.
<pjb> oh, at run-time. I skipped that.
karswell_ has joined #lisp
karswell has quit [Remote host closed the connection]
Cymew has joined #lisp
<jackdaniel> non-optimizing compilers may be also useful for producing result code which is meant to be read by a human - as a first draft (and tweaked after that manually), but that's very rare I suppose
rippa has quit [Ping timeout: 240 seconds]
Bronsa has joined #lisp
rippa has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
<pjb> Or also to get correct compilers that are easily provable or verifiable.
cage_ has joined #lisp
Cymew has quit [Ping timeout: 264 seconds]
<makomo> beach: "When a generic function or any of its methods mentions &key in a lambda list, the specific set of keyword arguments accepted by the generic function varies according to the applicable methods."
<makomo> clhs 7.6.5
<specbot> Keyword Arguments in Generic Functions and Methods: http://www.lispworks.com/reference/HyperSpec/Body/07_fe.htm
<makomo> "When a generic function *OR* any of its methods ..."
<makomo> "The set of keyword arguments accepted by the generic function for a particular call is the union of the keyword arguments accepted by all applicable methods and the keyword arguments mentioned after &key in the generic function definition"
<makomo> wouldn't this imply that an error should be raised?
<makomo> for my earlier example
nika_ has quit [Quit: Leaving...]
<makomo> i had only one method and it was applicable.
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
<makomo> or would that whole section of the standard only apply in the case when we have a &key in our GF
<makomo> but the first sentence does us "or" so...
<makomo> use*
Bronsa has quit [Ping timeout: 268 seconds]
kajo has quit [Ping timeout: 265 seconds]
al-damiri has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
surya has quit [Ping timeout: 260 seconds]
littlelisper has joined #lisp
fikka has joined #lisp
<littlelisper> i want to get the modification time of a file. is there any library for it? i googled but no help
nowhere_man has quit [Ping timeout: 256 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
<Xach> littlelisper: it is built-in to sbcl if that is what you use
milanj has quit [Quit: This computer has gone to sleep]
<Xach> littlelisper: also, file-write-date might get you what you want, but also might not
<littlelisper> Xach: how to? yes i use sbcl
<Xach> littlelisper: sb-posix:stat plus sb-posix:stat-mtime
<littlelisper> thanks Xach. and btw i just installed slime. its AWESOME
<Xach> slime is pretty handy
<Xach> i miss it whenever i can't use it
<littlelisper> its the best env i have used till date
<littlelisper> have you used smalltalk?
<Xach> No
<littlelisper> ah
nedlo_ has joined #lisp
mareskeg has joined #lisp
<makomo> if i'm writing a DSL and want my macros to be indented nicely, what are some general tricks or ways to structure these macros to make this happen
<makomo> "here" is where is how i want the process code to be aligned, "not-here" is what i don't want
<makomo> s/is where//
<makomo> defcomponent is my macro
karswell_ has quit [Ping timeout: 268 seconds]
MichaelRaskin has joined #lisp
<_death> I assume you're asking about the editor (emacs+slime) indenting it.. there's trivial-indent, but for more complicated macros you could patch cl-indent or otherwise write elisp code to do it
fikka has quit [Ping timeout: 260 seconds]
attila_lendvai has quit [Read error: No route to host]
<_death> I think lisp machine environments had more elaborate support for indentation
<makomo> _death: yeah, i'm assuming a conventional SLIME environment
sauvin has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
smurfrobot has quit [Remote host closed the connection]
fikka has joined #lisp
Patternmaster has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
LiamH has quit [Ping timeout: 276 seconds]
<Xach> I add properties to common-lisp-indent-function sometimes.
<Xach> e.g. (put 'common-lisp-indent-function ':implementation '(&lambda &body))
fikka has quit [Ping timeout: 240 seconds]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
littlelisper has quit [Quit: leaving]
Inline has quit [Ping timeout: 245 seconds]
charh has joined #lisp
littlelisper has joined #lisp
fikka has joined #lisp
<littlelisper> can i do specific imports, i mean only the functions i want from a library?
<_death> you can import specific _symbols_ from a _package_ using :import-from in your defpackage form
<pjb> littlelisper: nope.
<pjb> littlelisper: package manage symbols. Not functions.
nickenchuggets has quit [Read error: Connection reset by peer]
<littlelisper> ok _death , pjb
eli_oat has quit [Quit: Leaving.]
nickenchuggets has joined #lisp
nickenchuggets has joined #lisp
nowhere_man has joined #lisp
<pjb> Notice that import-from let you import non-exported symbols.
LiamH has joined #lisp
<littlelisper> pjb:i needed functions
<pjb> littlelisper: you will have to define your own function collection.
<pjb> littlelisper: but you have to decide how you will reference functions.
attila_lendvai has quit [Read error: Connection reset by peer]
EvW has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 264 seconds]
<pjb> (defparameter *my-fun-package-foo* (list (function sin) (function car) (function cos)))
<littlelisper> that means i can make my own package
<pjb> (defparameter *my-fun-package-bar* (list (elt *my-fun-package-foo* 0) (elt *my-fun-package-foo* 2)))
<littlelisper> ?
<pjb> So you have "imported" the first and third function from *my-fun-package-foo* into *my-fun-package-bar*.
<pjb> No, your own kind of "package".
<pjb> CL packages only deal with symbols, not with functions or variables or types or whatever the symbol is used to name.
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
<littlelisper> ah, i get it. so i can make my own collection
<littlelisper> thats good
<pjb> Yes. Notably this will allow you to collect anonymous functions.
LiamH1 has joined #lisp
<pjb> littlelisper: on the other hand, you may not care if the symbols used to name your function also name types or slots or variables or whatever.
<pjb> When we use the CL package system, we just don't care.
LiamH has quit [Ping timeout: 256 seconds]
<pjb> It also helps that global variables are special, therefore they are named with *stars-around*, and functions usually no. (even if some functions may be named with one or two postfix stars, like, f, f* and f**).
<pjb> So in general when you export a function FOO, there's no variable bound to FOO.
<pjb> On the other hand, it occurs often that you have both a type and a function using the same name: (typep (vector 1 2) 'vector) (typep (list 1 2) 'list) etc.
Fare has joined #lisp
fikka has joined #lisp
vlatkoB has quit [Remote host closed the connection]
littlelisper has quit [Ping timeout: 276 seconds]
vlatkoB has joined #lisp
slyrus_ has quit [Quit: Leaving]
<_death> (defpackage "AI" (:use "COMMON-LISP") (:export "THINK")) (defpackage "PERSONALITIES" (:use "COMMON-LISP") (:import-from "AI" "THINK") (:export "THINKER")) (in-package "PERSONALITIES") (defun thinker () (loop (think)))
littlelisper has joined #lisp
zachk has joined #lisp
zachk has quit [Changing host]
zachk has joined #lisp
davsebamse has quit [Quit: leaving]
littlelisper has quit [Client Quit]
milanj has joined #lisp
<warweasle> _death: I was hoping the singularity would hit today. I don't trust people to run things anymore.
slyrus_ has joined #lisp
Oladon has joined #lisp
<_death> warweasle: the last time I hoped for a singularity event was when I waited at some hospital queue (for a routine check) while the secretaries went superslow
Inline has joined #lisp
<MichaelRaskin> _death: let me assure you that it is in fact possible to intentionally program AI to maintain unacceptably slow speed of the queue
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
<_death> I compile C++ code daily so have no doubts there ;)
<aeth> If I compile a random program, I can tell you without looking at anything but htop if it's C++ or not.
<aeth> just the CPU usage bars of htop at the top
smurfrobot has joined #lisp
Kevslinger has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
<MichaelRaskin> A properly written makefile allows C compilation at 100% CPU load!
DemolitionMan has joined #lisp
<aeth> The difference, then, is how long it takes.
<_death> you need to use make -hal9000 though
<MichaelRaskin> aeth: Linux kernel will supply enough C files
<aeth> I'm not sure why people say SBCL takes a long time to compile or otherwise list its compile time as a disadvantage. (1) you only ever see that when you update QL and (2) it doesn't take very long, and this is even with only one core being used
<_death> it can take arbitrarily long
<Bike> it's not just when you update ql
<aeth> Well it's generally either very quick or an infinite loop bug, but, yes, you can put anything in compile-time
<Bike> what kind of weird attitude is that
<aeth> Bike: you generally only see everything being compiled when you ql:update-all-dists afaik.
<Bike> do you never rebuild your own software
<_death> interpreters etc. may use COMPILE/EVAL (hence there's FASTEVAL and such)
<aeth> Bike: The only thing that seems to be noticably slow in the entire compilation process is cl-sdl2 and that's probably because it uses autowrap
fikka has quit [Ping timeout: 240 seconds]
<Bike> the level of confidence you put into your assertions really doesn't match the evidence behind them
<aeth> everything I've written has had negligible compile times
fikka has joined #lisp
<aeth> Just under 3 seconds to build the largest thing that I've written in CL, which is about 7k lines of code, and it has one slow file because of an elaborate data structure.
EvW1 has joined #lisp
Arcaelyx_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<MichaelRaskin> I think full recompile of 60k lines of code took me way more than a minute.
smurfrobot has quit [Remote host closed the connection]
lumm has quit [Quit: lumm]
lumm has joined #lisp
<aeth> Let's say 2.8 and let's say it's directly related to LoC. 7k in 2.8 seconds is 2.5k a second. (/ 60d3 2.5d3) would then be 24 seconds. Actually sounds fairly plausible.
fikka has quit [Ping timeout: 260 seconds]
<aeth> My computer could be twice as fast as yours and/or your files could be more elaborate at compile time.
<aeth> This is assuming it's roughly linearly based on LoC, which is oversimplifying.
<sjl> ironclad takes 20s to compile/load for me, 25k loc according to cloc
<aeth> Of course, my 7k LoC CL would probably be at least 30k LoC C++
<sjl> that's the one I always notice taking a long time whenever I update my quicklisp dist
eli_oat has joined #lisp
eli_oat has quit [Client Quit]
makomo has quit [Quit: WeeChat 2.0.1]
<scymtym_> i halved SBCL's ironclad compile time some time ago. and this weekend, stassats halved it again
<aeth> 25kloc in 20 seconds would be 1.25 kloc/s.
nedlo_ has quit [Quit: Page closed]
<aeth> So... definitely possible to halve if your computer was of comparable speed to mine.
<aeth> (And I have an outlier file that probably could compile faster)
<aeth> Of course, kloc/s probably isn't the best measurement when you can do so much at compile time.
gurmble has joined #lisp
scymtym_ has quit [Remote host closed the connection]
fikka has joined #lisp
eli_oat has joined #lisp
grumble has quit [Ping timeout: 600 seconds]
gurmble is now known as grumble
eli_oat has quit [Client Quit]
attila_lendvai has quit [Read error: Connection reset by peer]
eli_oat has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
cage_ has quit [Quit: Leaving]
attila_lendvai has joined #lisp
eli_oat has quit [Client Quit]
fikka has joined #lisp
eli_oat has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
eli_oat has quit [Client Quit]
eli_oat has joined #lisp
smurfrobot has joined #lisp
eli_oat has quit [Client Quit]
eli_oat has joined #lisp
dented42 has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
smurfrobot has quit [Remote host closed the connection]
fikka has joined #lisp
kajo has joined #lisp
comborico1611 has joined #lisp
karlosz has quit [Ping timeout: 276 seconds]
fikka has quit [Ping timeout: 268 seconds]
catern has joined #lisp
karlosz has joined #lisp
mejja has joined #lisp
lumm has quit [Ping timeout: 245 seconds]
quazimodo has quit [Ping timeout: 240 seconds]
scymtym has joined #lisp
quazimodo has joined #lisp
smurfrobot has joined #lisp
karlosz has quit [Ping timeout: 276 seconds]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
shka_ has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
kuribas has quit [Remote host closed the connection]
dxtr has quit [Ping timeout: 240 seconds]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
fikka has quit [Ping timeout: 265 seconds]
Fare has quit [Ping timeout: 276 seconds]
lavaflow has quit [Read error: Connection reset by peer]
subroot has joined #lisp
fikka has joined #lisp
lavaflow has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
comborico1611 has quit [Quit: Konversation terminated!]
mercourisj has quit [Ping timeout: 248 seconds]
eli_oat has quit [Quit: Leaving.]
fikka has joined #lisp
Fare has joined #lisp
eli_oat has joined #lisp
<varjagg> say you'd want to persistently store user/token pairs
lumm has joined #lisp
<varjagg> what would you people use, in 2018
eli_oat has quit [Client Quit]
Myk267 has quit [Ping timeout: 265 seconds]
smurfrobot has quit [Remote host closed the connection]
mejja has quit [Quit: mejja]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
raynold has joined #lisp
Arcaelyx has joined #lisp
dented42 has joined #lisp
fraya has quit [Remote host closed the connection]
jonh has joined #lisp
defaultxr has quit [Quit: brb]
fraya has joined #lisp
karlosz has joined #lisp
Guest98966 has joined #lisp
Guest98966 has quit [Remote host closed the connection]
lumm has quit [Quit: lumm]
puchacz has quit [Quit: Konversation terminated!]
Fare has quit [Ping timeout: 248 seconds]
Fare has joined #lisp
vlatkoB has quit [Remote host closed the connection]
drastik_ has left #lisp ["WeeChat 2.1"]
<pjb> varjagg: (setf (sexp-file-contents "user-token.db") '(("pjb" . "DEADFACE") ("varjagg" . "12345678")))
<pjb> com.informatimago.common-lisp.cesarum.file:sexp-file-contents
<varjagg> pjb: thanks
mindCrime has quit [Ping timeout: 245 seconds]
<pjb> varjagg: the point is that it depends on what your operationnal constraints are.
fraya has quit [Remote host closed the connection]
<varjagg> i do something similar with cl-store now, but integrity is getting problematic
<pjb> If you have half a billion users, this won't do.
<varjagg> guess something transactional would be better
<pjb> Perhaps using a postgres database?
<varjagg> was thinking that, or sqlite
<varjagg> but not sure which cl glue is up to date now
<pjb> Again, depending on the number of processing acessing the data, the size of the data etc.
<pjb> You are not telling us anything…
<pjb> clsql, pg, etc.
wigust has quit [Ping timeout: 245 seconds]
<aeth> If you want reliability at scale, you should probably use postgresql.
<aeth> When CL is popular enough, it might even add s-expressions to its storage next to JSON and XML and whatever else.
<varjagg> har.
Cymew has joined #lisp
<aeth> PostgreSQL is definitely the way to go, though. Perhaps via postmodern. https://github.com/marijnh/Postmodern
<akkad> there are pure lisp postgresql drivers out there
<akkad> without falling back to cffi
<aeth> mySQL is for performance or ubiquity, SQLite is if you want to embed a SQL database, and noSQLs (including random CL-based storage systems) aren't a good fit for the problem.
<aeth> (And everything else costs money.)
Cymew has quit [Ping timeout: 260 seconds]
<varjagg> it's really simple: add, delete, fetch all
<varjagg> never update
<varjagg> ok, i'll try postgres as it seems to be the consensus
<varjagg> thanks for advice folks
<varjagg> just need to figure out which db glue to go
<varjagg> postmodern looks nice
<varjagg> and not abandoned
Fare has quit [Ping timeout: 276 seconds]
DemolitionMan has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
mareskeg has quit [Quit: mareskeg]
* slyrus_ likes Postmodern
smurfrobot has joined #lisp
andrei-n has quit [Ping timeout: 240 seconds]
LiamH1 has quit [Quit: Leaving.]
scymtym has quit [Read error: Connection reset by peer]
scymtym has joined #lisp
Guest51223 has joined #lisp
Guest51223 has quit [Remote host closed the connection]
noobly has joined #lisp
subroot has quit [Read error: Connection reset by peer]
<noobly> is anyone else having trouble accessing #emacs?
<aeth> It's possible that they make it require nickname registration to prevent being hit by the spambot that floods freenode from time to time
angavrilov has quit [Remote host closed the connection]
varjagg has quit [Quit: ERC (IRC client for Emacs 25.2.1)]
sjl has quit [Ping timeout: 240 seconds]
random-nick has quit [Ping timeout: 256 seconds]
noobly has quit [Quit: Page closed]
karlosz has quit [Ping timeout: 240 seconds]
karlosz has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
<edgar-rft> noobly: #emacs was locked for users with non-registered nicks a while ago because too much spam.
thodg has quit [Ping timeout: 256 seconds]
thodg has joined #lisp
daniel-s has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
dddddd has quit [Remote host closed the connection]
eli_oat has joined #lisp
slyrus has quit [Ping timeout: 245 seconds]
scymtym has quit [Read error: Connection reset by peer]
slyrus1 has joined #lisp
scymtym has joined #lisp
fikka has joined #lisp
slyrus1 is now known as slyrus
<MoziM> is there an elisp function that can change all the values of a property in a nested plist? this is an example of what i'm trying to navigate through, i want to set all :background properties to "black" http://termbin.com/9j5o
Bike has quit [Ping timeout: 260 seconds]
slyrus_ has quit [Ping timeout: 265 seconds]
robotoad has quit [Quit: robotoad]
<pjb> MoziM: like in CL, there's subst
<pjb> But you need something more sophisticated.
fikka has quit [Ping timeout: 260 seconds]
fisxoj has joined #lisp
slyrus_ has joined #lisp
eli_oat has quit [Quit: Leaving.]
attila_lendvai has quit [Read error: Connection reset by peer]
mareskeg has joined #lisp
<karlosz> i forgot slime has a handy profiler
<karlosz> profiling the stuff i wrote yields
<karlosz> converting to SSA takes the most oamount of time, no surprise there
<karlosz> the passes after that dont seem to contribute too much
fikka has joined #lisp
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
<karlosz> it seems that converting to hir takes 2 out of the 10 seconds it takes to compile alexandria
<karlosz> so source->hir conversion is 20%
<karlosz> (that's what compile-cleavir is in the report above)
<karlosz> errr wrong channel
fikka has quit [Ping timeout: 264 seconds]
kajo has quit [Ping timeout: 265 seconds]
pbgc has quit [Quit: Computer has gone to sleep.]
mooog has joined #lisp