libera/#commonlisp - IRC Chatlog
Search
2:22:44
White_Flame
the &body form will indent only 2 spaces or so, while the non-&body tends to indent in line with the 2nd element of the list (eg, the test)
2:24:24
White_Flame
regarding linebreaks, the major thing is that open parens shouldn't end a line, and closing parens shouldn't begin a line
3:03:56
mfiano
I would urge against putting a loop clause at the end of a line, such as DO. That just makes reading harder.
3:05:34
White_Flame
if I have multiple WITH or FORs, I often do (loop <nl> for ... <nl> for ... ) to keep the header forms aligned
3:06:23
mfiano
But here the second "..." is at the end of the line, so it's fine, assuming "..." doesn't end in a keyword.
3:09:29
hayley
I put the first loop clause on the first line of a LOOP form, so (loop for ... <nl> for ... <nl> ...) The number of possible LOOP styles is huge.
3:09:30
mfiano
It even indents :when/:do and similar things that indicate nesting, assuming some SLIME variable is set, and you use keyword-interned keywords.
3:11:20
mfiano
What I was thinking of, is it will align the ":" of keyword-interned symbols on adjacent lines, with some lisp-mode variable set.
3:11:47
mfiano
Which is handy for LOOP, with keyword-interned symbols, to be more readable, like a property list with keyword symbol keys.
3:12:18
mfiano
I forget what that variable is called, or if it is now set by default (it's been like 10 years since I know for a fact it was not the default)
3:13:16
White_Flame
where every loop keyword within the form is &body-indented, not aligned to the (loop <term> ...) term
3:16:35
beach
But, yes, I agree, for other constructs I sometimes need to add a newline to get things to line up, mostly due to the brokenness of the Emacs indentation algorithm.
3:20:32
mfiano
As mentioned, using keyword-symbol LOOP keywords does help Emacs' lisp-mode indentation algorithm in certain situations.
3:41:44
dieggsy
FWIW i found this, which is rather sweet and simple https://github.com/mohe2015/schule/blob/818c0499cb6904ec5ef6d325f4636410b7fa5913/src/libc.lisp
3:42:15
dieggsy
i was leaning towards FFI anyway but i've not actually used CFFI so it certainly expedites things to find someone's already had your exact idea lol
3:57:19
mfiano
dieggsy: You would be losing a lot of the benefits of Common Lisp by punting to foreign code.
3:58:48
dieggsy
there's no built-in way to do it. there's a periods library that has a strptime but it's weirdly too permissive
3:59:20
mfiano
Yes. You can no longer guarantee that a conforming program will run N decades from now, or currently on other operating systems, such as Mezzano. Instead, use local-time.
3:59:22
dieggsy
I could certainly try and write my own CL strptime but that feels even more like reinventing the wheel
3:59:43
dieggsy
mfiano: local-time doesn't handle custom string formats, unless i missed that part of the docs
4:01:13
dieggsy
mfiano: it's not about amount - i have strings like "YY.DDD" that I need turned into some lisp time object or unix time
4:02:52
dieggsy
I was already writing a bunch of regex to handle all the cases, but i also have to validate the dates etc.
4:03:40
dieggsy
"write your own date parsing library" is historically a pretty solid way of shooting oneself in the foot though
4:04:35
dieggsy
so I was just looking at other options. perhaps strptime through CFFI isn't a good option then. but i always like to look at "short of writing it myself, what's the best alternative"
4:06:46
dieggsy
Respectfully, I disagree that it's "lazy" to not write everything yourself/investigate the alternatives, especially given that I mentioned I was already going down that path
4:07:50
dieggsy
What kind of an engineer would I be if i couldn't make the best use of the tools at my disposal, heh. Write my own tools too, sure. But they're not mutually exclusive
4:07:55
mfiano
I and many others make an effort to ensure no transitive dependency is using needless foreign code. You do what you wish though.
4:08:11
dieggsy
you make a good point about portability though so that's certainly something to consider
4:08:45
dieggsy
At the same time, there is FAR too much code in our codebase where someone went "i'll just do it myself" and it's a hot mess so
4:11:48
dieggsy
i'm doing my best to steer us right though, and i think i agree haphazardly introducing an FFI dependency doesn't do that so
4:14:09
mfiano
Sure. It just pains me when people _needlessly_ use foreign code. It only hurts the Lisp ecosystem and annoys the purists (read: most of us :)). I'm sure beach and others will chime in with more reasons when they've had their coffee.
4:14:50
dieggsy
Well, i'm certainly more of a pragmatist than a purist, but you can be one and the other, and in some cases you have to be one to be the other
4:15:21
mfiano
I've been working on a game engine for approximately 10 years now, and if I had to use foreign code, I would probably just use C, heh.
4:15:50
dieggsy
I enjoy hearing opinions in any case, even (especially?) those I might not initially be inclined to agree with. I've no real ego about my programming lmao
4:19:28
dieggsy
As a chicken schemer at heart, foreign code is one of the major selling points there
4:19:58
mfiano
For example, in my domain, game development, whenver I interface with the OS for I/O I must use C at some level, whether it's a syscall, or some hardware abstraction layer. In my case, the only foreign code I use is SDL, and it's largely unavoidable mostly due to GPU manufacturers releasing binary blob drivers.
4:21:11
mfiano
This does limit the machines that can run my code, but SDL is pretty widespread and touches everything that has a GPU driver available for it anyway, so I don't mind. It does mean though that I am at the mercy of the project unless I write an abstraction layer.
4:24:18
mfiano
Yes, it happened reliably when I dragged a window, and my X server usually runs for months at a time without an issue. :)
4:25:50
dieggsy
The other thing is you don't always have full control over your code, e.g. we depend on proprietary databases etc. anyway
4:47:07
beach
The only thing I can add, or rather emphasize, is that FFI solutions tend to benefit only the individual, whereas if that individual spent a little bit more time to create or add to a pure Common Lisp library, we would collectively benefit.
4:57:09
mfiano
I suppose sometimes an individual is a team, in which case, the decision to depend on foreign code should be more carefully weighed, and knowledge of the entire team's working environment and compatibility/issues with said foreign library in that environment.
6:03:20
lisp123
If anybody wants an Emacs shortcut to re-run the expression entered into the SLIME REPL (useful for re-running tests), you can use this (thanks pjb for parts of the code): https://pastebin.com/NJ7CE4Lx
6:06:57
lisp123
M-p is from within the REPL, this can be used from any buffer (so saves having to switch to the REPL and back) -- I may be mistaken though and there is some other way
12:15:21
lisp123
pjb: Is there a way to use both IBCL & CL-STEPPER together? I tried it and it seems to work, but I have to resolve some conflicts during the ASDF load process (which may just be some incorrect setup on my end)
14:21:00
Fade
Bell is the conglomeration of telecommunications companies (the baby bells) that resulted from the US federal government breaking up AT&T
14:22:04
Fade
anyhow, I was just commenting on the network resets that cascaded through the channel.