pierpal has quit [Remote host closed the connection]
Pixel_Outlaw has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
housel has joined #lisp
igemnace has joined #lisp
ArthurAGleckler[ has quit [Ping timeout: 245 seconds]
thorondor[m] has quit [Ping timeout: 245 seconds]
RichardPaulBck[m has quit [Ping timeout: 240 seconds]
drunk_foxx[m] has quit [Ping timeout: 240 seconds]
hdurer[m] has quit [Ping timeout: 240 seconds]
theemacsshibe[m] has quit [Ping timeout: 240 seconds]
Jachy has quit [Ping timeout: 240 seconds]
GNUPONUT[m] has quit [Ping timeout: 276 seconds]
remix2000[m] has quit [Ping timeout: 260 seconds]
kumori[m] has quit [Ping timeout: 260 seconds]
LdBeth has quit [Ping timeout: 260 seconds]
z3r0d5y[m] has quit [Ping timeout: 245 seconds]
eli_oat[m] has quit [Ping timeout: 245 seconds]
dirb has quit [Ping timeout: 256 seconds]
blep-on-external has quit [Ping timeout: 256 seconds]
katco[m] has quit [Ping timeout: 256 seconds]
plll[m] has quit [Ping timeout: 240 seconds]
Guest14000 has quit [Ping timeout: 256 seconds]
EuAndreh[m] has quit [Ping timeout: 260 seconds]
CharlieBrown has quit [Ping timeout: 240 seconds]
wetha has quit [Ping timeout: 245 seconds]
manila[m] has quit [Ping timeout: 260 seconds]
eatonphil has quit [Ping timeout: 260 seconds]
equalunique[m] has quit [Ping timeout: 255 seconds]
spectrumgomas[m] has quit [Ping timeout: 276 seconds]
lyosha[m] has quit [Ping timeout: 256 seconds]
can3p[m] has quit [Ping timeout: 256 seconds]
kammd[m] has quit [Ping timeout: 276 seconds]
igemnace has quit [Quit: WeeChat 2.1]
nika_ has joined #lisp
nika has quit [Ping timeout: 240 seconds]
mooshmoosh has quit [Ping timeout: 240 seconds]
mooshmoosh has joined #lisp
Murii_ has joined #lisp
nika_ has quit [Client Quit]
fikka has joined #lisp
FreeBirdLjj has joined #lisp
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 264 seconds]
thinkpad has quit [Quit: lawl]
fikka has joined #lisp
wigust has quit [Ping timeout: 248 seconds]
wigust has joined #lisp
thinkpad has joined #lisp
pjb has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
shka_ has joined #lisp
MichaelRaskin has joined #lisp
LdBeth has joined #lisp
joh11 has joined #lisp
<joh11>
Hi guys ! I just had a small question
<pjb>
Apparently, not small enough for this margin.
<joh11>
if I called a function foo from the repl that calls another function bar, is there a way, when I recompile bar that foo automatically use the new version ?
<joh11>
ok I lied ti wasn't that small xD
<pjb>
This is not specified by the standard, but of course, one can design an algorithm to include in an implementation to do that.
<pjb>
Also, have a look at ibcl, you could implement it in an implementation independent way, as an add-on library.
<MichaelRaskin>
Also, check if the desired behaviour is already what your implementation does
<pjb>
For functions defined in the REPL, this is already the case, it's automatic. Also, functions defined in different compilation units when compiled (usually different files).
<joh11>
Im just messing with sdl2 and wanted to leave my window opened while coding other stuff, this works with variables but not with functions apparently
<MichaelRaskin>
Also often true if you load files by LOAD
<pjb>
joh11: said otherwise, the called functions are "hardwired" in the caller only when the called function is declared INLINE and not NOTINLINE, or when they're in the same compilation unit.
<pjb>
joh11: in the other cases, the calls go (semantically) thru the symbol-function, so if you redefine a function, it's taken into account next.
<joh11>
ok so if I mark foo as NOTINLINE, or place it in another file than bar it should work ?
Naergon has joined #lisp
<pjb>
Yes.
<pjb>
If your program design depends on changing the function definition at run-time, do declare it NOTINLINE.
<joh11>
ok
<joh11>
man lisp is just so cool
<pjb>
so about FUNCTION, FDEFINITION, SYMBOL-FUNCTION, the thing is that they return the function object. If you store it somewhere, and redefine the function, then those old function objects are still used.
<pjb>
This is one important difference between (apply (function foo) args) and (apply (quote foo) args).
<pjb>
In the first case, the function object is passed, in the second case, the symbol FOO is passed. In the later case the APPLY function will call SYMBOL-FUNCTION itself, so if the definition of FOO has changed, APPLY will use the last fbinding, ie. the redefinition.
lumm has joined #lisp
<pjb>
Assume the function or object are not passed directly, but stored somewhere before the call.
<joh11>
wow didn't thought about it
<joh11>
so to be sure I should use ' instead of #' in my apply calls ?
<pjb>
For example, if you play with reader macros: (set-macro-character #\^ 'reader-macro-for-^) is better while developping it and testing it, because just redefining the function is enough for the reader macro to take it into account. With (set-macro-character #\^ #'reader-macro-for-^) you will have to re-evaluate this form each time you modify the function.
<pjb>
joh11: you should use ' or #' depending on your meaning!
<pjb>
Ie. if you write a HOF (high order function, a function that takes functions as arguments), instead of restricting it to functions (checktype fun function), you should allow function designators (deftype function-designator () `(or function symbol)) (checktype fun function-designator)
<joh11>
ok thanks !
<pjb>
So the user of your function can choose.
Tristam has quit [Ping timeout: 264 seconds]
wetha has joined #lisp
kammd[m] has joined #lisp
GNUPONUT[m] has joined #lisp
CharlieBrown has joined #lisp
remix2000[m] has joined #lisp
spectrumgomas[m] has joined #lisp
drunk_foxx[m] has joined #lisp
Guest3496 has joined #lisp
eatonphil has joined #lisp
katco[m] has joined #lisp
theemacsshibe[m] has joined #lisp
eli_oat[m] has joined #lisp
Jachy has joined #lisp
thorondor[m] has joined #lisp
blep-on-external has joined #lisp
manila[m] has joined #lisp
EuAndreh[m] has joined #lisp
kumori[m] has joined #lisp
plll[m] has joined #lisp
equalunique[m] has joined #lisp
hdurer[m] has joined #lisp
RichardPaulBck[m has joined #lisp
lyosha[m] has joined #lisp
<joh11>
ok so I moved bar to another file but now I have another problem : my (format t "test") are not displayed
z3r0d5y[m] has joined #lisp
dirb has joined #lisp
can3p[m] has joined #lisp
ArthurAGleckler[ has joined #lisp
<joh11>
but I am sure it is called
<joh11>
and I used (force-output) after
buffergn0me has quit [Ping timeout: 240 seconds]
milanj has joined #lisp
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
doesthiswork has joined #lisp
dddddd has joined #lisp
fikka has joined #lisp
wigust has quit [Ping timeout: 240 seconds]
Tristam has joined #lisp
robotoad has quit [Quit: robotoad]
milanj has quit [Read error: Connection reset by peer]
fikka has quit [Ping timeout: 255 seconds]
Amany has joined #lisp
Amany has quit [Client Quit]
milanj has joined #lisp
lumm has quit [Quit: lumm]
shangul has joined #lisp
<pjb>
joh11: err, moving to a different file is not necessarily the best option. It makes it implicit. And usually files are used to organize things by module (or by package), rather than on such technicality. It would be better to just (declaim (notinline bar)).
<pjb>
format t outputs to *standard-output* which may be bound to different streams at different times, and streams can be redirected to various places.
EvW has joined #lisp
<joh11>
pbj: yeah but in my case it makes more sense because it is a collision handling function so it is ok to place it elsewhere
<pjb>
joh11: you may also use STEP to see what functions are called, step by step. In ccl, cl:step is not implemented, so you may use cl-stepper instead. https://groups.google.com/forum/#!search/cl-stepper$20lisp$20informatimago/comp.lang.lisp/nj3jFxcJYM0/QbzGkAbyAtMJ (cd ~/quicklisp/local-projects ; git clone http://github.com/informatimago/lisp informatimago) before quickload.
<joh11>
thanks, anyway im using sbcl
loke has joined #lisp
<pjb>
good. still consider cl-stepper, it has nice features. (eg. (step (foo) :trace) will prints a trace of all steps. (big output). Happily (or not), cl-stepper works by instrumenting the code, so it only steps the code that has been compiled with cl-stepper instead of cl.
<pjb>
)
<joh11>
the dreaded unclosed parenthesis xD
<pjb>
:-)
<jackdaniel>
you may be a meanie and cause a serious distress to most channel participants by ending your sentence with opening parenthesis (
<joh11>
so I will have to store a variable to the *standard-output* so that it is not shadowed by the sdl stuff ?
<joh11>
or there is a cleaner way to do it
<jackdaniel>
it may be not enough, *standard-output* may be a synonym stream!
<pjb>
also, say, debugging "traces". There's a *debug-io* but it's for interactive debugging, it may be connected to GUI instead of logs…
<pjb>
or of course you can (defvar *my-trace-output* *standard-output*) but this would duplicate *trace-output* for no good reason apparently.
random-nick has joined #lisp
<makomo>
if i have a class and i have functions (instead of methods, because i don't need the genericity) that perform operations on objects of this class
<makomo>
how should i name the functions?
<joh11>
pbj: ok it works now with a (defvar *my-stream* *trace-output*) but only when I press enter on the repl so not that great. Anyway it was only for debug purposes, I'll use step instead
<pjb>
makomo: name the function after the result produced.
<pjb>
Eg. SIN is named because it returns the SINUS of the argument.
<pjb>
STRING-UPCASE is named like that, because it returns an upcased string from the string designator argument.
<pjb>
etc.
<pjb>
For procedures (operators that don't return anything specific, but that have specific side effects), name them after the main side effect.
<pjb>
Eg. PRINT is called PRINT because it prints stuff. FORMAT is called FORMAT because it formats stuff. READ is called READ because it reads stuff.
<makomo>
pjb: it's not always that easy :/. this function returns the clock's state (computed as a function of the clock's current cycle)
<makomo>
just naming it STATE would be dumb
<pjb>
makomo: clock-state
<makomo>
naming it clock-state is better
<makomo>
yes. what i was aiming for is, whether or not i should use CLOCK- as a prefix all the time for such functions
<makomo>
but i'm also not sure if i should make them be methods instead
<pjb>
joh11: for debugging purposes you can go ahead and use directly *trace-output*. What do you mean only on the REPL? Do you run it otherwise?
<pjb>
makomo: perhaps not systematically.
<pjb>
For example, if you have a function that returns the hour from your clock, just call it HOUR. No need for a CLOCK-HOUR with the prefix.
<makomo>
yeah, and if there's also SECONDS for example
<makomo>
SECONDS is too vague imo
<makomo>
it really depends on the word
<pjb>
makomo: but also, it's a question of style and of API. If you define functions for an API (if they're exported from your package) you should think ahead to keey it stable on long term. So if now it's a mere function, it could become a generic function later.
<makomo>
and if later on you end up with a word that's too vague, you'll have to rename everything else to be consistent
<pjb>
Using the prefix is often seen. It's the default for defstruct accessors.
<makomo>
pjb: yup true. although, for generic functions there's usually no problem, since you have specialization going on
<pjb>
You can also use unicode: ⌛hour ⌛minute ⌛seconds ;-)
<makomo>
hah :D
<pjb>
(nope, don't do that in a public library).
<pjb>
(defconstant ½ 1/2) (* ½ 3) #| --> 3/2 |#
<makomo>
damn, sometimes i miss static typing and overloading
pierpal has joined #lisp
<pjb>
makomo: generic functions can be overloaded with various methods.
<joh11>
pjb: nevermind I found the problem. I forgot to specify the stream in (force-output) it was *standard-output* that was flushed, and I had to press enter (or any expr) in the REPL to show it
<makomo>
pjb: i guess, but that requires using generic functions instead of normal functions
<makomo>
which isn't a downside by itself, but eh, still
<pjb>
joh11: ok.
pyx has joined #lisp
pyx has quit [Client Quit]
Deathspe11 has joined #lisp
fikka has joined #lisp
EvW has quit [Ping timeout: 255 seconds]
doesthiswork has quit [Quit: Leaving.]
nowhere_man has quit [Ping timeout: 255 seconds]
fikka has quit [Ping timeout: 240 seconds]
jmercouris has joined #lisp
JuanDaugherty has quit [Quit: Exeunt]
joh11 has quit [Quit: Leaving]
<ebzzry>
Xach: thanks for verifying. it builds well now. it was my connection, indeed.
<aeth>
A prefix is a good way to handle things (I see it sometimes even for defclass accessors)
<aeth>
You can always hide the prefix with a macro
fikka has quit [Ping timeout: 245 seconds]
igemnace has joined #lisp
<Xach>
ebrasca: phew
<Xach>
sorry
<Xach>
meant for ebzzry
Tristam has joined #lisp
dddddd has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 240 seconds]
kenanb has left #lisp ["ERC (IRC client for Emacs 26.1)"]
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
nowhere_man has quit [Remote host closed the connection]
thodg has quit [Ping timeout: 256 seconds]
nowhere_man has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
fikka has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
igemnace has quit [Remote host closed the connection]
milanj has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
doesthiswork has joined #lisp
shangul has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
Beep-Lord has joined #lisp
EvW has quit [Ping timeout: 255 seconds]
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #lisp
lnostdal has quit [Ping timeout: 260 seconds]
fikka has joined #lisp
nowhere_man has quit [Ping timeout: 245 seconds]
fikka has quit [Ping timeout: 264 seconds]
Murii_ has quit [Quit: Leaving]
<shka_>
heh, i just opened request to add to the quicklisp code that was stolen from the quicklisp client
<shka_>
i feel so dirty :P
<Xach>
it's all good
<Xach>
shka_: would you consider adding some example usage to the README?
orivej has joined #lisp
<shka_>
I am doing it right now
shangul has quit [Remote host closed the connection]
Murii_ has joined #lisp
makomo has quit [Quit: WeeChat 2.0.1]
shangul has joined #lisp
<shka_>
Xach: done
<Xach>
yay
markoong has quit [Ping timeout: 276 seconds]
markong has joined #lisp
lumm has joined #lisp
<beach>
I think I have a FAIRLY complete description of my planned nursery garbage collector. More examples and more figures will be added, but I think it is complete enough to be presented to a wider audience: http://metamodular.com/garbage-collection.pdf
lumm has quit [Remote host closed the connection]
<beach>
It is a bit long, but there are lots of figures, so it is not as bad as it looks.
<beach>
Remarks are welcome, as usual.
lumm has joined #lisp
<beach>
Next, I'll be doing more work on the description of the synchronization between nursery collectors and the global collector.
<shka_>
cool
milanj has quit [Quit: This computer has gone to sleep]