freenode/#lisp - IRC Chatlog
Search
8:12:16
knobo
I've made a live-reload prototype for clack. It works for files, but now I want to add support for reload when I recompile a function.
8:16:26
knobo
Like, if it is possible to trace the function call tree when an url is accessed, and send update to the browser when any of those functions are recompiled.
8:27:05
knobo
Maybe use some xref functionality, but I still don't know how to hook that in to the compiler.
8:31:09
blep-on-external
like you're given the request object and the response object and you have to parse them and all tha
8:45:05
knobo
blep-on-external: but nobody uses only clack. Most people would use somthing on top. For example caveman.
11:02:00
jmercouris
I'm looking here at gentle introduction to symolic computation and they say you can only sharp-quote normal functions, can't do it for macro functions
11:02:00
minion
jmercouris, memo from flip214: if the image is uncompressed, the mmap() is quite fast. if it's compressed, larger images will take more time to run.
11:02:52
jmercouris
is this something that SBCL does not obey from the specification? is the author mistaken?
11:07:01
shka
jmercouris: don't count on doing that though, standard states that if is a special form and it is up to implementation to decide how to implement it
11:11:58
jmercouris
I always thought mapcar was a strange name, and it only just occured to me that we are mapping a function onto the car of each cons cell
11:13:55
jmercouris
ebzzry: I'm not there yet though, don't want to go down that rabbit hole just yet, first I would like to finish this book
11:15:31
jmercouris
I've already done PCL, and I've been doing some lisp programming for approximately a year now, but I felt there are so many gaps in my knowledge, decided to go back to basics from cover to cover
11:16:22
ebzzry
jmercouris: that’s ok. you’ll get a better appreciation of recursion in lisp with that book.
11:16:55
jmercouris
I intend to become much better at recursion, its been a weakness of mine for a long time
11:17:19
jmercouris
there are some exercises where I feel like I am wasting my time, but for the most part, it has been a very valuable experience
11:40:34
beach
jmercouris: You can use MACRO-FUNCTION to get to the function that a macro defines, but it has a strange signature, so you can't just FUNCALL it with the arguments to the macro.
11:43:56
jmercouris
"Determines whether symbol has a function definition as a macro in the specified environment. "
12:43:22
beach
I guess I can test the memory allocator by allocating and freeing random chunks and verifying after each operation how much total space is left on the heap.
13:41:38
borodust
it's weird, it should have been fixed a week ago when i saw it first appeared in 06/25 report..
14:55:07
cnx
hi guys, suddenly my swank from emacs cannot be loaded, saying `Package ASDF does not exist.'
15:01:19
jackdaniel
cnx: I assume you try to load *all* contribs including swank-asdf, because swank itself does not depend on asdf whatsoever
15:01:53
jackdaniel
most likely scenario is that you had quicklisp initialized in your implementation init file (i.e ~/.sbclrc) and you have removed it
15:09:36
theseb
is this a great macro strategy?....do as much as you can with a "normal" function and then call that helper function from your shiny new macro?....in short..use macros to change the syntax of the language but do the real work in regular code?
15:12:01
theseb
beach: thanks...people were always warning about overdoing it with macros...my strategy above seemed like such a simple way to strike a balance...it should be more widely taught
15:12:47
beach
theseb: It's the traditional way of doing it, but perhaps it is not said so explicitly in the literature.
15:14:59
beach
But if you look in the CLIM II specification, for instance, you will find several pairs like WITH-FOO and INVOKE-WITH-FOO.
15:18:16
theseb
Xach: everyone knows Common Lisp is the Lisp for "real work"...however...I've been checking out Clojure which seem to also be good for "real work" since uses JVM...what do think of Clojure?
15:19:38
jmercouris
Isn't it possible to run CL on the JVM? I thought there was an implementation that had interop of some sort
15:22:43
figurelisp
I have heard a lot about lisp. Is it good to learn it now? I am thinking about common lisp
15:23:33
francogrex
hi, I have a lisp (or fasl) file in a specific common network directory/folder (UNC path: //network1/specs/called.fasl) that is being loaded from a user's local lisp program. is there a way to make sure that the user is loading that specific fasl file (and not a local one he may have copied into his local folder?)
15:24:45
figurelisp
I'm new in programming so i don't know other languages well and won't be able ito compare it
15:25:06
Josh_2
well I learned CL first and now I don't want to learn any others cos I'm lazy and they suck
15:26:26
jmercouris
Anyways, these kinds of debates are pointless, if you wish to learn Lisp, obviously you'd have the endorsement of this channel
15:27:48
jackdaniel
any argument supporting my ideas is valid. contrary arguments are just other people delusions (and false claims), like it ought to be ;-)
15:28:00
jmercouris
figurelisp: If you decide to learn lisp start with this book: https://www.cs.cmu.edu/~dst/LispBook/book.pdf and install this editor: https://portacle.github.io
15:28:01
Josh_2
figurelisp: get gentle introduction to symbolic computation, is very good intro to programming :)
15:28:01
figurelisp
I'll be starting learning CL from the book cl: gentle introduction to symbolic computimg
15:29:14
jackdaniel
jmercouris: confirmation bias won't do any good to you. Lisp zealotry just closes you in a fixed mindset.
15:30:14
jackdaniel
usually jokes carry convictions despite being humorous, but tha'ts offtopic on my side, sorry
15:31:21
beach
figurelisp: Make sure you ask for advice when you get ready to install your environment. It is easy to get it wrong.
15:32:36
beach
figurelisp: Also, it is OK, to paste your code somewhere and give us a link, in case you want feedback on it. Newbie questions are tolerated as long as it looks like you are making progress and following advice.
15:46:56
schweers
figurelisp: my advice: don’t let people tell you that the lisp you chose (Common Lisp, as I understand) has some flaw, and that another lisp is better. Or at least in some way better. Its not that they are wrong (if you really want to do functional programming, Clojure has a more pleasant out of the box experience). Its that you shouldn’t let that distract you. I made that mistake, bouncing from one lisp to anothe
15:47:46
Josh_2
schweers: idk if I agree with you, GISC is a real good intro to functional programming
15:52:17
jmercouris
When writing predicates, when do you use a hyphen, and when do you just stick it onto the word?
15:52:43
schweers
jmercouris: I think most people use a dash if the predicate consists of more than one word
15:56:29
random-nick
is the proper naming convention for definition macros to prefix with "def" if it is just one word and to use dashes and prefix it with "define-" for multiple words?
15:58:45
Xach
concluding with: The name string-less-p would incorrectly imply that it is a predicate that tests for a kind of object called a string-less, and the name stringlessp would connote a predicate that tests whether something has no strings (is "stringless")!
16:09:41
jmercouris
If I use (with-slots) within a method body, is it any quicker than using the slot accessors every time?
16:15:16
makomo
jmercouris: i'm not sure if this is correct (someone can correct me), but i would think it could be slower because it has the extra dispatch to go through for the accessor
16:16:56
makomo
jmercouris: also, WITH-ACCESSORS supports any accessor and doesn't have to be used just for objects/slots
16:17:20
beach
jmercouris: WITH-SLOTS uses SLOT-VALUE. SLOT-VALUE takes a symbol to name the slot. If the implementers are not careful, they have to look up the name, find the slot metaobject, find the slot offset, then access the slot.
16:18:40
makomo
beach: we discussed this once -- the fact that WITH-ACCESSORS doesn't have to be used just for slots. is this true or is my memory just failing?
16:18:48
jmercouris
I feel like maybe the only way to really learn this stuff is to make your own CL implementation of the spec
16:21:32
beach
Look at the bottom of the Common Lisp HyperSpec page. It says what with-accessors does.
16:22:10
makomo
for some reason i thought you were limited to instanced of classes that are DEFCLASS'd
16:23:13
makomo
it's not complicated. maybe it's just because you've only heard about it for the first time
16:23:52
jmercouris
makomo: I don't know, I just have these vague ideas in my mind, it would seem to me that with-slots is kind of like some version of let, so you don't have to keep getting the value every time
16:26:07
makomo
jmercouris: ah, well, it could have been made to do that instead i guess. it's all about the documentation and standardized stuff in the end :D
16:27:35
beach
jmercouris: And, in the worst case, it must find the class of the object (another function call), then find the slot metaobject with that name (another call), then access that object to find the slot offset (another call), then access memory (another call).
16:28:05
makomo
jmercouris: heh, that's how i felt while implementing this macro: https://plaster.tymoon.eu/view/844#844. now i finally feel like the idea has crystallized
16:28:14
beach
jmercouris: There are tricks to get around it when the slot name is quoted, but it is not simple to implement.
16:58:15
jasom
beach: can you declare the type of an object in such a way to remove some of those lookups (with declarations in the standard)?
17:00:49
Bike
strictly speaking, the compilation semantics allow you not to worry about that, i think
17:01:41
Bike
that is, there's no restriction that the slots of a class have to be the same at compile and run time
17:42:01
Bike
"Classes defined by defclass in the compilation environment must be defined at run time to have the same superclasses and same metaclass." is the text
17:42:41
jasom
So it would require a separate declaration that indicates the class would not be redefined.