kevingal has quit [Remote host closed the connection]
trocado has quit [Remote host closed the connection]
igemnace has joined #commonlisp
taiju has quit [Ping timeout: 268 seconds]
waleee has quit [Ping timeout: 260 seconds]
Guest7427 has quit [Ping timeout: 268 seconds]
waleee has joined #commonlisp
random-nick has quit [Ping timeout: 260 seconds]
karlosz_ has joined #commonlisp
mfiano has joined #commonlisp
waleee has quit [Ping timeout: 268 seconds]
waleee has joined #commonlisp
waleee has quit [Ping timeout: 260 seconds]
lisp123 has joined #commonlisp
winning-luser has joined #commonlisp
lisp123 has quit [Ping timeout: 268 seconds]
<winning-luser>
how did software engineers on old lisp machines track bugs and timelines for features to implement? was there any precursor to modern issue trackers and such around then?
<Catie>
It's not about Lisp Machine programmers, but this article discusses a minimal issue tracker that was thrown together in 1986 and used for many years thereafter
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
dre__ has quit [Quit: Leaving]
dre has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
karlosz_ has quit [Quit: karlosz_]
akoana has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
igemnace has quit [Ping timeout: 268 seconds]
igemnace has joined #commonlisp
gaqwas has quit [Ping timeout: 260 seconds]
gaqwas has joined #commonlisp
beach` is now known as beach
<beach>
Good morning everyone!
<lisp123>
Hello Beach
<lisp123>
What's your programming plans for today?
<beach>
I need to make sure the SICL cross compiler uses different environments for macro expansion and load-time execution.
<lisp123>
Great - good luck!
<beach>
Thanks.
<beach>
During cross compilation, the compilation itself is done by code running in the host, so if some functions are called during macro expansion, like in this case FORMAT as I discovered yesterday, they need to be the host version.
<beach>
But currently, I use the target version of those functions, so when I load SICL FORMAT into an environment that is subsequently used for macro expansion, things break horribly.
<lisp123>
Sounds tricky
<beach>
A bit. Shouldn't be that hard though.
<beach>
I said "host version" but it could be the SICL version running in the host, of course.
semz has quit [Ping timeout: 260 seconds]
<lisp123>
Ah, then you have access to more than 1 global environment :)
<beach>
Yes, currently 7 during bootstrapping for different phases, including the single host environment.
semz has joined #commonlisp
Bike has quit [Quit: Connection closed]
pranavats has left #commonlisp [#commonlisp]
taiju has quit [Ping timeout: 260 seconds]
pranavats has joined #commonlisp
asarch has joined #commonlisp
bcasiello has joined #commonlisp
qhong has joined #commonlisp
<Josh_2>
Mornin' beach
qhong_ has quit [Ping timeout: 245 seconds]
s-liao has joined #commonlisp
asarch_ has joined #commonlisp
asarch has quit [Ping timeout: 268 seconds]
asarch_ has quit [Ping timeout: 268 seconds]
taiju has joined #commonlisp
fitzsim has quit [Ping timeout: 264 seconds]
silasfox has quit [Ping timeout: 260 seconds]
bcasiello has quit [Ping timeout: 260 seconds]
shka has joined #commonlisp
Catie has quit [Quit: rcirc on GNU Emacs 29.0.50]
aartaka has joined #commonlisp
heisig has joined #commonlisp
Lycurgus has joined #commonlisp
lisp123 has quit [Quit: Leaving...]
shka has quit [Ping timeout: 268 seconds]
attila_lendvai has joined #commonlisp
taiju has quit [Ping timeout: 260 seconds]
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
rotateq has joined #commonlisp
kadir has joined #commonlisp
frgo_ has joined #commonlisp
frgo has quit [Ping timeout: 260 seconds]
frgo_ has quit [Ping timeout: 260 seconds]
taiju has joined #commonlisp
White_Flame has quit [Remote host closed the connection]
White_Flame has joined #commonlisp
amb007 has quit [Ping timeout: 268 seconds]
pranavats has left #commonlisp [#commonlisp]
amb007 has joined #commonlisp
aartaka has quit [Ping timeout: 260 seconds]
hendursa1 has joined #commonlisp
asarch has joined #commonlisp
hendursaga has quit [Ping timeout: 276 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
frgo has joined #commonlisp
varjag has joined #commonlisp
rogersm has quit [Quit: Leaving...]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
rogersm has joined #commonlisp
dec0d3r has quit [Remote host closed the connection]
amb007 has quit [Read error: Connection reset by peer]
Lycurgus has quit [Quit: Exeunt]
amb007 has joined #commonlisp
taiju has quit [Ping timeout: 260 seconds]
taiju has joined #commonlisp
asarch has quit [Quit: Leaving]
nckx is now known as Thunderbi
Thunderbi is now known as guix-znc-test
guix-znc-test is now known as guix
guix is now known as nckx
<rotateq>
beach: Imagine you must use Word for the SICL documentation.
<rotateq>
Or UML-diagrams. :)
akoana has quit [Quit: leaving]
s-liao has quit [Ping timeout: 256 seconds]
<beach>
Thankfully, I don't have any such constraints.
<loke[m]>
What do you mean "or"?
<loke[m]>
You'll write the documentation in Word, and all theatre diagrams should be drawn using Powerpoint.
<rotateq>
loke[m]: of course :P
<rotateq>
As all other people used Power Point for the presentation one fundamental thing came to my mind, you can't even have comments that are not shown in the final thing.
s-liao has joined #commonlisp
<rotateq>
or I missed some of its "power"
<pjb>
rotateq: you had some nightmares this night?
<pjb>
Halloween after effect?
<rotateq>
pjb: yes!
<rotateq>
oh I wanted to make some more halloweenmath with this funny LaTeX package
<rotateq>
or with the coffeestains package, but i drink none ^^
<loke[m]>
rotateq you can have slides that are hidden. That's there only way, I think.
<loke[m]>
There are also the comments on you can include that mention something other people.
<beach>
How about finding a subject that is a bit more on topic?
<rotateq>
uii, but I won't invest the time better sharping my beamer skills :)
<rotateq>
beach: yes sorry, I wanted to ask you something ontopic, but I don't remember right now.
<rotateq>
I had on Sunday some weird problems with MACROLET on SBCL that it didn't see former lexical functions.
<beach>
That's a problem with your code and not with SBCL.
<beach>
MACROLET works at compile time, but lexical functions are not available until run time.
<beach>
"the consequences are undefined if the local macro definitions reference any local variable or function bindings that are visible in that lexical environment."
<flip214>
why is in SBCL (via swank) the first line broken at 281 characters, the second indented and broken at 79 characters?
<flip214>
I'd like all output in one line
<_death>
:right-margin is for the pretty printer, but you pass :pretty nil?
s-liao has quit [Ping timeout: 256 seconds]
hisacro has joined #commonlisp
<flip214>
_death: yeah
<flip214>
I also tried :miser-width and :length
<_death>
probably I don't understand what you want to output..
<flip214>
everything in one line: #( .... )#\Newline
<flip214>
without the newline, even
amb007 has quit [Read error: Connection reset by peer]
<_death>
(write (make-array 100 :initial-element 0) :pretty nil :readably t) gives one line here
amb007 has joined #commonlisp
<flip214>
via swank??
<_death>
sure
<_death>
are you mistaking the returned value for the printed text?
<flip214>
ah yeah, thanks
<flip214>
no, but my *standard-output* was a swank stream which gets broken up
<flip214>
with a (with-output-to-string (*standard-output) ...) it works as expected
<flip214>
sorry about the noise
pve has joined #commonlisp
<_death>
there's write-to-string btw.. and possibly want to wrap with w-s-io-s
<flip214>
thanks
waleee has joined #commonlisp
cosimone has quit [Ping timeout: 260 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
edgar-rft has joined #commonlisp
trocado has joined #commonlisp
attila_lendvai has quit [Ping timeout: 264 seconds]
tfeb has joined #commonlisp
hofensta_ has joined #commonlisp
pranavats has left #commonlisp [#commonlisp]
tfeb has quit [Client Quit]
perrierjouet has quit [Ping timeout: 260 seconds]
tfeb has joined #commonlisp
tfeb has quit [Client Quit]
yewscion has quit [Quit: Connection closed]
rotateq has quit [Remote host closed the connection]
yewscion has joined #commonlisp
kadir has left #commonlisp [#commonlisp]
ec has joined #commonlisp
yewscion has quit [Client Quit]
yewscion has joined #commonlisp
perrierjouet has joined #commonlisp
booaa has joined #commonlisp
booaa has quit [Client Quit]
booaa has joined #commonlisp
commandoline has left #commonlisp [Bye!]
tyson2 has quit [Remote host closed the connection]
waleee has quit [Quit: WeeChat 3.3]
booaa has quit [Ping timeout: 260 seconds]
voltron has joined #commonlisp
<dieggsy>
does anyone know if making an array of e.g. type '(unsigned-byte 8) in SBCL will actually be stored efficiently using a char (or whatever the smallest machine type is to hold the type)?
<beach>
Pretty sure it will use a single machine byte for each element.
<beach>
`char' is not a machine type though. It's a C-ism.
<White_Flame>
yes, SBCL has specializers for smaller integers, as well as single/double floats as well iirc
Inline has joined #commonlisp
<White_Flame>
*array specializers
<dieggsy>
beach: good point. and that's awesome
<beach>
I haven't checked the code, though. That's just how I would do it. :)
<dieggsy>
wonder if there's an easy way to check this sort of thing... maybe some object size method ?
<dieggsy>
it's more just for my own curiosity anyway. thanks
<beach>
Sure. There wouldn't be much point in having the type if it weren't for the efficient storage. This type is not required by the standard.
pranavats has joined #commonlisp
<White_Flame>
dieggsy: I look at the disassembly, and how many bytes are actually allocated
<White_Flame>
although you can M-. into make-array to look at its code & what sorts of things it has around it
<Josh_2>
_death: You here?
<Josh_2>
(I do not have hours and hours of problems I need help with dw)
<Josh_2>
Also good afternoon peeps :)
ec has quit [Ping timeout: 276 seconds]
<Bike>
there is sb-ext:primitive-object-size in recent versions of sbcl
<Bike>
have not used it myself
trocado has quit [Ping timeout: 264 seconds]
<pjb>
dieggsy: I'm not sure it's awesome. It may be a big problem: If you do (incf (aref foo 0)) in one thread, and (incf (aref foo 1)) in the other thread, the you will get more memory contention with bytes than with long words…
<dieggsy>
pjb: well, there are some ways it's awesome jaja. could you elaborate on what you mean here though?
heisig has joined #commonlisp
yewscion34 has joined #commonlisp
ec has joined #commonlisp
yewscion has quit [Ping timeout: 268 seconds]
khrbt_ has quit [Ping timeout: 268 seconds]
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
<Josh_2>
This might be a stupid question considering the author, but where are the docs for Clack?
<contrapunctus>
Josh_2: going by his lack of proficiency in English, it's probably difficult for him to write. I'm sure you'd help out more than a few people if you contributed some docs...
<Josh_2>
I dont know how to use clack
<Josh_2>
Even japanese docs would work because you can just crudely translate with google translate, but at the end of the day its the code examples that are the most important
<Josh_2>
Alright. Well I appreciate your scouring but I'm just gonna use ol trust Hunchentoot
<Josh_2>
ol trusty*
ec has joined #commonlisp
tyson2 has joined #commonlisp
khrbt has joined #commonlisp
aeth has quit [Ping timeout: 268 seconds]
aeth has joined #commonlisp
<pjb>
dieggsy: it depends on the width of the memory bus. Nowadays, most often the memory bus is 4 byte wide. ie. you read 32-bit, and you write 32-bit.
<pjb>
dieggsy: so the addresses sent to the memory chip are actually pointer>>2 ; the last 2 bits are just use to index a byte into the 32-bit registers.
<pjb>
dieggsy: so when you do (incf (aref foo 0)) on a byte array, you actually read 32-bit (ie. (aref foo 0) … (aref foo 3)), get the valuel (aref foo 0), increment it, and build a new 32-bit value with the new (aref foo 0) and the other (aref foo 1) … (aref foo 3), then store that 32-bit word back to memory.
<White_Flame>
cache & main memory also have different memory structures
<White_Flame>
but at least the DDR4 is 64-bit wide, not 32
<pjb>
dieggsy: obviously, if another threads tries todo the same on (aref foo 1), both threads will try to access the same 32-bit word, so they will have to be synchronized.
<pjb>
And indeed, there's also the problem of cache, in addition.
<White_Flame>
I think DDR5 is moving to dual 32-bit buses, instead of a single 64-bit one
<dieggsy>
pjb: Oh, jeez, I see. Thanks! Is there no real way to mitigate this besides just ... don't do things in parallel when working with types smaller than 32?
<dieggsy>
or like a mutex
<pjb>
dieggsy: Well, in general it doesn't matter much, but I wanted to note that having specialized arrays to small bits of data is not "awesome" in the absolute; it can serve its purpose, but depending on what you do, it may not be the best choice.
<pjb>
And indeed, you will have often coarser mutexes anyways.
<pjb>
Where it can be good is to deal with big data that is byte-sized: this optimizes the space required to store it. And also, when you use it as a buffer for I/O, since I/O on posix system is performed on a byte basis.
ec has quit [Ping timeout: 276 seconds]
<dieggsy>
pjb: The question is vaguely inspired by this ... "game" (more of a mental exercise) I like to think about just to exercise my brain. Like, what's the largest practical chunk of this map I can store in memory/what's the smallest amount of information I can use to describe this tile. etc. i got around to actually coding bits and pieces once, but yeah it's more just hypotheticals
<pjb>
But besides those use case, having just arrays of T can be more efficient (speed and complexity wise).
<copec>
White_Flame, As the clock goes up, the bus width for each link is going to necessarily going to have to be reduced for effective designs
<dieggsy>
so space optimization is vaguely where I was coming from, aware that space optimization isn't exactly the solution to gigantic maps when you have things like procedural generation but. still fun to think about I guess
<pjb>
Well, if you need to compress data, you can go the specific encoding way, or you can just use a standard compressing algorithms…
<pjb>
Depending on the use case.
<dieggsy>
Fair
<White_Flame>
copec: yep, and they're moving to 4 voltage level signaling, too
<pjb>
in CL you can use bit-vectors or integers with DPB and LDB to store fields of bits of variable length.
<pjb>
So there's way to optimize storage if needed.
<White_Flame>
(hmm, not finding it, maybe it was just PCIe5 that went to quad voltage instead of just binary)
<dieggsy>
pjb: oh neat, i didn't know about those functions
<White_Flame>
copec: those are the DC voltage regulators, moving from the motherboard onto the chips
<White_Flame>
but I think the actual line signaling is still binary I guess
<copec>
It says "Each DIMM has two independent channels. While earlier SDRAM generations had one CA (Command/Address) bus controlling 64 or 72 (non-ECC/ECC) data lines, each DDR5 DIMM has two CA buses controlling 32 or 40 (non-ECC/ECC) data lines each, for a total of 64 or 80 data lines."
<White_Flame>
oh, just in terms of the change from 1x64 to 2x32, yeah
<copec>
Is there a writing style of CL that pretty much all advanced CL programmers find great?
<White_Flame>
indentation, good docstrings, good comments?
<White_Flame>
the actual style & organization is really dependeng on the particular codebase
<White_Flame>
simply for the fact that you can build your own per-project infrastructure easily
<White_Flame>
but I really, strongly dislike uncommented code
<White_Flame>
and documentation that doesn't include examples
<copec>
Yeah, I don't like where everything is individually explained, but doesn't draw any cohesive whole
aartaka has quit [Ping timeout: 264 seconds]
<copec>
documentation that misses the forest for the trees
<copec>
It does seem a whole separate skill you have to develop, to know when and how to explain for an average reader
<copec>
Something I really need to work on
<White_Flame>
it does. skill of writing (as in like writing books/articles/etc)
<White_Flame>
but really, all you need is to get burned a few times with your own old code, and not knowing what it's doing, to teach a good lesson of explaining to yourself
<White_Flame>
and comments really help with a lot of rubber-duck design & debug
aartaka has joined #commonlisp
<Catie>
One of the biggest things that's always helped me is docstrings on all the functions that describes what the parameters are for and what you can expect to be returned or signalled
<White_Flame>
and don't pollute the docstring with how the function works, put those in the comments. Docstring is for usage
<beach>
White_Flame: I totally agree. I find my own comments invaluable for understanding what is going on.
<White_Flame>
my wetware memory is terrible. I need comments even for new code :-P
<Catie>
White_Flame: you're not alone on that one, I'm right there with you
<beach>
White_Flame: I am not far behind.
<Catie>
Useful parameter names also do me a lot of good. The main reason I can't use CLISP for most development is that it doesn't save parameter names, it just gives "arg0, arg1 ..."
ec has quit [Ping timeout: 276 seconds]
<White_Flame>
oh, and once you have more than one &optional parameter, consider changing to keywords
<White_Flame>
positional ordering of &optionals can get really problematic if you need to change the parameters
<White_Flame>
and keywords will signal errors instead of just putting the wrong value in the wrong optional slot
<copec>
I'm trying to compose good stuff, and not just throw away for myself
<White_Flame>
comments above code are much easier to read than off to the right
<White_Flame>
if the simple steps you take with your traversal API require comments like this, you might want to create more helper functions/macros to read in the more simple terms that your comments use
<copec>
👍
<White_Flame>
however, I tend to write comments of this low level nature when in the middle of writing code, then delete some of them or summarize at the top of the loop with a longer sentence
<beach>
copec: Your UNLESS is a violation of the rules on page 13 of the LUV slides.
<beach>
copec: They recommend you use only truly Boolean expressions in the condition.
<copec>
I see
<beach>
copec: And I agree with the comments-above-code remark.
<beach>
In fact, all anaphoric macros violate this rule by nature.
<beach>
And, yes, most of those comments should be turned into named functions.
<beach>
Like SET-OF-REACHABLE-STATES-EXISTS-P
<copec>
wow, lots of great things to think about
<beach>
And the comment "add current state-prev" is an example of a comment that paraphrases the code. Those should be avoided.
jealousmonk has joined #commonlisp
cosimone has joined #commonlisp
kadir has left #commonlisp [#commonlisp]
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
cosimone has joined #commonlisp
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
yewscion34 has quit [Ping timeout: 264 seconds]
CaCode_ has joined #commonlisp
CaCode has quit [Ping timeout: 268 seconds]
ec has quit [Ping timeout: 276 seconds]
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
aeth has quit [Ping timeout: 260 seconds]
aeth has joined #commonlisp
Jing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ec has joined #commonlisp
fitzsim has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
Oladon has joined #commonlisp
fitzsim has joined #commonlisp
even4void has joined #commonlisp
yewscion has joined #commonlisp
ec has quit [Ping timeout: 276 seconds]
tyson2 has quit [Remote host closed the connection]
ec has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
tyson2 has joined #commonlisp
molson has joined #commonlisp
<Inline>
frigging build for redsbcl was failing due to a bye; missing in reduce build.sh after a if blah then << if blah then ... >>
<Inline>
hmm i changed that to if blah then << if blah ....>> bye; and now it doesn't hang anymore and i got an image for sbcl heh
<Inline>
and i can run the image fine
<Inline>
not sure if the noncore packages were built into really tho...
<Inline>
that part was too fast to be good
<Inline>
i have a question
<Inline>
if i got 2 images, can i use both of them like -core image1.img -core image2.img ?
<Inline>
kinda like appending ?
ec has quit [Ping timeout: 276 seconds]
waleee has joined #commonlisp
ec has joined #commonlisp
aeth has quit [Ping timeout: 268 seconds]
akoana has joined #commonlisp
aeth has joined #commonlisp
epolanski has quit [Quit: Connection closed for inactivity]
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
<copec>
beach, when you say only truly boolean expressions, that means something that only returns t/nil?
ec has quit [Ping timeout: 276 seconds]
tyson2 has quit [Remote host closed the connection]
<copec>
so would it be okay to have my own function ie (when (is-foo-p 'foo) ...
<copec>
is-foo-p => t | nil
rogersm has quit [Quit: Leaving...]
<copec>
Or should it be captured ahead of time, and then I should just use alexandria:when-let
<pjb>
copec: no, he means expressions that return a boolean OR a generalized boolea.
<pjb>
copec: well, since boolean is a subtype of generalized boolean, it's really only expressions returning generalized boolean.
<pjb>
copec: BUT
<pjb>
copec: the thing is that in CL generalized boolean = T. Ie any object is a generalized boolean.
<pjb>
copec: if that object is NIL, then it means false, all the other objects mean true.
<pjb>
copec: it's a matter of intent.
<copec>
Yeah, that's what I'm depending on with when
<pjb>
copec: so for example, (= 1 1) may return anything that is not NIL. it could return 1, 42, "hello" or T.
voltron has quit [Remote host closed the connection]
<pjb>
copec: but the intent, and the specification is that it returns a generalized boolean.
<copec>
I wrote SET-GET-ELEMENT => element if in set | nil
<pjb>
copec: on the other hand,
<copec>
so (unless (set-get-element element set) 'bleh)
<pjb>
on the other hand, can I find an example of a function that doesn't return a generalized boolean that may return nil or not nil?
<pjb>
copec: yes, your example is like gethash.
<pjb>
it returns the element, or nil if not found.
rogersm has joined #commonlisp
<pjb>
so it returns a generalized boolean.
ec has joined #commonlisp
<pjb>
let put it aside for the moment.
<pjb>
there is worse: there are functions that are predicate, but that also return a useful value !!!
<Guest74>
I think the style guide is about not using generalized booleans.
<Guest74>
though i don't agree. They're in the language for a reason.
<pjb>
for example, digit-char-p is specified as a predicate. (digit-char-p #\x) #| --> nil |# (digit-char-p #\3) #| --> 3 |# but when given a digit char, it is specified to return the integer represented by this digit char!!!
<pjb>
so while it's a function that is not intented to return a mere boolean, it still return a generalized boolean, but it also return (or null (integer 0 36)) (subtype of T).
<pjb>
and of course, you have the functions that return lists.
<pjb>
take just (list) (list 1)
<pjb>
(list) #| --> nil |# (list 1) #| --> (1) |#
<pjb>
so the function list intent is to return a list, not a boolean.
<pjb>
In that case one would prefer to write (if (endp list) … …) instead of (if list … …) (the … are swapped, of course).
<pjb>
for functions like gethash, or your set-get-element, I think they're like digit-char-p, even if a-priori they lean more on the value function side rather than on the predicate side.
<pjb>
but the main problem here is that it depends on what you put in the structure.
<copec>
I understand that embedding expressions that aren't truly boolean expressions in anaphoric macros can be problematic, but I haven't studied the details of how it makes that expansion go awry
<pjb>
for example (defparameter *is-prime* (make-hash-table)) (if (gethash n *is-prime*) (process-prime n) (factorize n))
<pjb>
on the other hand (defparameter *names* (make-hash-table)) (if (gethash foo *names*) (process-named foo) (error "~S has no name" foo))
<pjb>
If you write: (if (not (gethash foo *names*)) …) how do you argument for a generalized boolean --> boolean function NOT on a (or null string) ???
<pjb>
You could write: (if (null (gethash foo *names*)) …) testing for the symbol NIL explicitely. But why favorize testing for NULL over testing for strings? wouldn't (if (stringp (gethash foo *names*)) …) be preferable?
<pjb>
I argue that (if (gethash foo *names*) (process-named foo) (error "~S has no name" foo)) is a nice idiom that everybody understands.
<pjb>
In general, IMO there's no reason to shy away type punning. For one thing, it doesn't concern a lot of cases, only NIL / lists / boolean / absent values in CL.
<pjb>
We have the case in C, with NULL == 0 == false (which is even a little worse than in CL, because the value false is 0, as is the value of the integer 0, (ie. a field full of 0 bits), but the value of NULL can be a field of bits different from 0!!! Only that in the case where 0 is taken as a pointer (eg. (void*)0 or when comparing it with a pointer such as NULL==0, the value of (void*)0 may be this field of bits different from 0 that
<pjb>
represent the NULl pointer.
aeth_ has joined #commonlisp
<pjb>
And what this means, is that in some cases, if you have a pointer and try to compare it with a null pointer, (eg. if a system definition of NULL is not available), comparing it with 0 or not comparing it to anything may be preferable.
aeth has quit [Killed (NickServ (GHOST command used by aeth_))]
aeth_ is now known as aeth
<pjb>
In the end, my style in C also evolved to avoid comparisons with NULL, or with 0 (as a boolean or a pointer).
<pjb>
It's both idiomatic and perfectly defined what foo* p=… ; if(p){ … } else { … } means as well as (let ((p …)) (if p … …)) means.
<pjb>
and notice that as you would NOT write if(b==false){…}else{…} I see no reason to write (if (eq b nil) … …) or (if (null b) … …)
<pjb>
and (if (not b) …e …t) can as well be written as (if b …t …a) if b is really a boolean.
Skyfire has quit [Quit: WeeChat 3.3]
<pjb>
And finally, and more generally, about those coding style rules. I would mention, that coding style or not, you must know the syntax and semantics of the whole language to understand all the code you read. If you adhere too strictly to coding style rules, up to the point in writing actually your code in a sublanguage, you can forget the actual language in which you're programming and misunderstand expressions that are valid but that
<pjb>
you don't expect anymore.
<pjb>
In C in particular, the language being so baroque most C programmers are not programming in C, but in an invented language (partly subset, partly superset, but with just the right intersection) It's even more visible in C++ where the language you're using must be explicitely specified (both formally and informally), since it's rather impossible to use raw C++.
<pjb>
But happily this is not the case in lisp, where everything is consistent and orthogonal.
<pjb>
So coding styles are only useful to have some consistency and to help understanding but IMO they shouldn't be strict at all.
<copec>
^I'm not Japanese, but I was saying hai throughout that while paying attention
<pjb>
Try to avoid if(b==true) … or if(b==false) … in C, and try to avoid the equivalent in other languages.
<dre>
copec, nice
<pjb>
ie. take the contraposed of beach's rule. When it's a boolean don't use null (or endp), and use not only if you really need to invert the test (it may be preferable to swap unless/when than to use not).
<dre>
I like to say "neh neh" like koreans do
<pjb>
hmm in French :-)
<pjb>
That said, if you are hired to work on a project with coding style, do respect them, it's not worth arguing :-)
ec has quit [Ping timeout: 276 seconds]
ec has joined #commonlisp
<shka>
i agree with most beach's guidelines, and i was trying to follow that one as well
<shka>
but... no...
aeth has quit [Ping timeout: 264 seconds]
lisp123 has joined #commonlisp
<lisp123>
pjb: Great write up
aeth has joined #commonlisp
<lisp123>
One thing I have been trying to do more is to use the write code for the job
tyson2 has joined #commonlisp
<lisp123>
Is it function that will only ever be used in the context of the calling function? I write those as flet
<lisp123>
If they are recursive, then write as labels
<lisp123>
Are the inputs likely to be variant in type? Generic Function. If they will always be the same, normal function
<lisp123>
Also, using imperative programming (a sequence of bindings within LET*) where appropriate (more specific code, also when there is more state?) and recursive functions / declarative code where it is more appropriate (more abstract code)
<lisp123>
Actually my goal has also been to remove all comments from a function -> the code should stand on itself and be self documenting. It's hard and requires a few refactors at time, but I am leaning this way. The issue with over documenting via comments or long doc strings is that it requires the reader to maintain two models - the plain text version and the actual code
<lisp123>
However, my plan is to introduce my own framework for additional documentation w.r.t to pseudocode / intent etc. as a separate property of the function (store in hash table) and to the bottom of the file
<lisp123>
^ Slowly working towards that, but currently my projects are too small for it to matter as much
<copec>
That's nice
<copec>
The documentation system, not necessarily you working towards that, although that's nice too :-P
<lisp123>
copec: :P I figured ;)
<lisp123>
It does make sense and is probably why a lot of documentation is lacking towards one of the four types of audiences
<Josh_2>
Have you tried something like 40ants/doc?
<lisp123>
I need to reach out to him, I saw that but didn't fully follow / hadn't had the time to sit down and go through it. Staple by Shinmera is another one
<Shinmera>
That is me hello
<lisp123>
:)
kevingal has joined #commonlisp
<Shinmera>
Staple kinda sucks and I'd like to redo it (again), but I lack the time (again).
<Shinmera>
The best parts of Staple are its code parsing subsystem to provide xrefs within code snippets, and the separate library called Definitions.
<lisp123>
Oh I didn't know that, I will have a look at those two
<Shinmera>
Oh and linking to source locations from the documentation sections is also cool.
<Shinmera>
Which it does thanks to Definitions.
<Shinmera>
(and some metadata crunching)
<lisp123>
Shinmera: p.s. I've been doing my own mini extension to Parachute whereby one can evaluate a form in the REPL and then save it and its result as a unit test (e.g. (is equal ... ...))
<Shinmera>
cool
<lisp123>
You can probably do a much better version, but I thought the idea was cool
<Shinmera>
Maybe, but I most certainly don't have the time to make one :)
<lisp123>
I can imagine. CL is sorely lacking a CLONE-USER function in its standard library
<Shinmera>
As it happens I don't even have the time to tackle the issues that were reported for Parachute :(
cage has quit [Remote host closed the connection]
makomo has joined #commonlisp
<hayley>
lisp123: COPY-USER poses more problems than any other generic object copying function in Common Lisp would.
random-nick has joined #commonlisp
ec has quit [Ping timeout: 276 seconds]
ec has joined #commonlisp
<lisp123>
hayley: That's true. It would require careful separate lest two copies interact with a shared resource and the fabric of space-time would tear apart
Oladon has quit [Quit: Leaving.]
makomo has quit [Quit: WeeChat 3.2]
lisp123 has quit [Quit: Leaving...]
shka has quit [Ping timeout: 268 seconds]
igemnace has quit [Ping timeout: 260 seconds]
ec has quit [Ping timeout: 276 seconds]
aeth has quit [Ping timeout: 268 seconds]
heisig has quit [Ping timeout: 268 seconds]
aeth has joined #commonlisp
winning-luser has quit [Remote host closed the connection]
ec has joined #commonlisp
hofensta_ has quit [Ping timeout: 268 seconds]
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
ec has quit [Ping timeout: 276 seconds]
amb007 has quit [Read error: Connection reset by peer]
ec has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
cosimone` has joined #commonlisp
cosimone has quit [Ping timeout: 268 seconds]
epolanski has joined #commonlisp
bcasiello has joined #commonlisp
dec0d3r has joined #commonlisp
ec has quit [Ping timeout: 276 seconds]
ec has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
Catie has quit [Changing host]
Catie has joined #commonlisp
kevingal has quit [Ping timeout: 268 seconds]
<etimmons>
Anyone know of a portable, lock free mailbox implementation? (Similar to the one in sb-concurrency)
pve has quit [Quit: leaving]
ec has quit [Ping timeout: 276 seconds]
<pjb>
isn't the one in sb-concurrency portable?
phantomics has joined #commonlisp
ec has joined #commonlisp
thomaslewis has joined #commonlisp
<etimmons>
Portable across OSes probably, but not implementations
<Catie>
I remember seeing one that falls back on sb-concurrency. Let me see if I can't dig it up again