freenode/lisp - IRC Chatlog
Search
22:14:01
nwoob
I learned recursion from little schemer and there is not return statement while calling recursive function but in other languages I have to add return statement before recursive call why?
0:12:47
kinope
_death: It looks like a sentinel only in name, but its not like a sentinel that you'd use for a list. It's a symbol called 'empty, and it probably exists for the very readon
0:14:27
kinope
the queue doesnt dereference values so it needs a quick way to determine if the queue is effectively empty
0:19:08
kinope
in the case that the queue is effectively empty the head and tail pointers are changed to point to it. But they are not really pointers either, they are just numbers that are used in an array/vector indexing operation
1:36:41
kinope
Morning all! Question. Is it just a matter of style whether one should make a small abstraction like (not (null x)) => not-empty_p, as an inlined function or a macro?
2:00:34
edgar-rft
kinope: I usually decide such a question by looking at my code. If the code is littered with (not (null x)) or some other repetitive pattern I try to find a shorter abstraction for it, but only if it makes the code easier to understand for a human. Every abstraction makes it necessary to learn a new symbol, so it makes no sense to abstract each and everything that only appears rather seldom in my code.
2:06:48
kinope
edgar-rft: Great! thanks. Should one make the abstraction a macro or a inlined function depending on the complexity of the operation?
2:08:59
no-defun-allowed
Macros shouldn't be where functions can be used, so an inlined function would suffice.
2:51:41
White_Flame
a big problem with inline functions in SBCL in particular, is that if you end up with hundreds of them in a single function body (as in a macroexpansion), it can massively slow down compilation
7:10:23
pve
Good morning! Is there a recommended/easy way of testing code on multiple implementations? I mean something I can give my code to and get back compilation and test results for each implementation.
7:25:35
axion
GitHub actions is what we use for pngload: https://github.com/bufferswap/pngload/runs/694176572?check_suite_focus=true
7:29:43
axion
Xach: That reminds me, I think zpb-exif PR #4 is required for pngload to build in next Quicklisp dist release.
7:30:18
pve
there wouldn't happen to be a script I could use to fetch and compile the most recent versions of each implementation? my distro is a bit out-of-date on this..
7:33:35
pve
perhaps I could try to make a docker image with a few implementations + cl-all or cl-test-grid
7:48:42
Posterdati
beach: another problem is the 'volt*ampere unit which is reduced to 'watt, in this case we cannot reppresent electrical apparent power which is V*A...
7:52:35
pjb
Posterdati: I don't see how it prevents it. The point being that units don't embody the whole physics!
7:52:55
pjb
It's not because you write a unit-consistent expression that you have modelized an actual physical phenomenon!
7:56:11
flip214
If you put a not-pure-ohmic thing on AC, you get a complex wattage (because V and I are phase-shifted)
7:57:22
flip214
you calculate the "real" power for the generator, and use the magnitude to dimension the conductor
7:57:43
flip214
Posterdati: yeah, for virtual loads you use VA, but that's just to differentiate in writing
7:59:46
pjb
It would be a very bad idea, in a computer system, to encode any meaning into different unit names.
8:00:06
pjb
If you have to encode some physical meaning, do it explicitely, not by the name or factorization of the unit!
8:01:52
Posterdati
pjb: V*A is not J/s if you consider a sinusoidal circuit, infact you can have work only by the real part of the complec power not the magnitude!