<subhuman>
Is there a native function in CL that's parallel to remove-if* in qlet-2?
<akoana>
somehow strange in sbcl 2.2.9 repl: just entering (defun f1 () (expt 4 (expt 4 4))) works, but entering (defun f2 () (expt 4 (expt 4 (expt 4 4)))) never returns. On the other hand clisp shows its prompt immediately after having entered the second defun. (SBCL uses also almost 100% CPU)
<akoana>
is this behavior just a bug and does not happen in later SBCL versions?
<subhuman>
beach: I think I'll look at the map* primitives and see if I can make something decent out of them
<beach>
subhuman: Plus, your names are misleading. It is not just because a variable is special that it is bound, and it is not just because a variable is lexical that it is unbound.
<beach>
subhuman: You never answered my question about LOOP.
<subhuman>
beach: I know
<subhuman>
I just want to know if a variable is special
<beach>
But that's not what your names suggest.
<subhuman>
beach: Because they're lacking their appropriate context
<subhuman>
The macro isn't in it's appropriate context
<subhuman>
OH u mean the vars in multiple-value-bind
<subhuman>
yeah whatever
<subhuman>
I totally recognize that but I just wrote it like that out of convenience
<subhuman>
I'll definitely change them
<beach>
akoana: It might be that it is trying to compute the result at compile time, since the values are known, and it might be too much for the compiler to deal with.
<akoana>
beach: thanks, that sounds plausible
<subhuman>
beach: I don't want to use LOOP right now
<subhuman>
I'll play around with the map* primitives
jon_atack has joined #commonlisp
<beach>
I can't say I understand why you want to avoid LOOP, but that's your choice.
<beach>
akoana: If you do (defun f2 (x) (expt 4 (expt 4 (expt 4 x)))) instead, it returns immediately, which supports my hypothesis.
jonatack has quit [Ping timeout: 264 seconds]
<akoana>
beach: indeed, just before a monent i tried something similar :), thank you!
<beach>
Sure.
<beach>
subhuman: You also didn't tell me why you want to assign to the special variables rather than binding them.
<subhuman>
beach: Do you not reckon I can get the same macroexpansion with the map* primitives?
<subhuman>
My first intuition whenever I want to do transformations akin to this is to use map* primitives
<subhuman>
That's why I'm temporarily abstaining from LOOP, may I say
<beach>
subhuman: I don't know. I find the mapping functions useful when the function to be mapped already exists, but less readable than LOOP when a new anonymous function must be supplied.
nybble has quit [Ping timeout: 246 seconds]
donleo has joined #commonlisp
<subhuman>
My logic is that if I can reasonably do the same with map* primitives then using LOOP is kinda too much for my tastes
<beach>
*sigh*
<subhuman>
Maybe I'll change in that regard along the line though
jrx has joined #commonlisp
<beach>
subhuman: This is not a good way to reason about code.
<beach>
subhuman: And again, you didn't tell us why you want to assign to the special variables rather than binding them.
<beach>
... so we still don't know the reason for the macro.
<beach>
subhuman: The very name of the macro is misleading because it suggests that bindings are in effect for the code in the body, but in fact, the macro has side effects outside of the scope of the body.
<subhuman>
That's what I want
<subhuman>
I just named it like that out of convenience
<subhuman>
I'll try to find the original problem that I had and you can take a look at it
<beach>
I am not expressing myself very well...
dino_tutter has joined #commonlisp
<subhuman>
I understand you
<beach>
subhuman: You submit code for us to read, but you don't tell us the reason for its existence. Then the name of the macro is misleading and the names of your variables are misleading. Finally, you say you want the shortest solution, but we have to take into account some tastes of yours that you didn't initially mention.
<subhuman>
The original problem most likely requires a paradigm shift more than anything else but at the same time I believe all this is an exercise of what I can do with CL
<subhuman>
I'm not a programmer by trade, more of a hobbyist
<beach>
subhuman: I am sorry, but I am not going to read the code in that last paste in order to guess your reason for writing the macro.
Colleen has quit [Quit: Colleen]
Colleen has joined #commonlisp
<subhuman>
You asked why so I provided
<subhuman>
It's cool though
<beach>
I was expecting an explanation rather than code using libraries I don't know. But it's fine.
<subhuman>
I'll explain it now
<beach>
subhuman: Oh, and your macro doesn't work. Try (let ((x 10)) (declare (special x)) (sb-cltl2:variable-information 'x))
<beach>
You are not taking into account the environment.
valorzard has quit [Quit: Client closed]
<subhuman>
beach: I've never touched environments and it's not my imperative to do so right now, I'd love to in the future though
<beach>
But if you don't, you won't know whether a variable is special or not.
<subhuman>
The reason I used `sb-cltl2:variable-information' is to check if a symbol was either a defvar or defparameter
<subhuman>
If you know another way that's more suitable for my use-case then please do tell
wbooze has joined #commonlisp
rainthree has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
subhuman has quit [Ping timeout: 260 seconds]
<beach>
In case someone is interested in implementing non-trivial floating-point mathematics functions in Common Lisp, we have an embryonic library for it, but most of the work is still to be done: https://github.com/s-expressionists/Buoy
<ixelp>
GitHub - s-expressionists/Buoy: Embryonic floating-point library for Common Lisp
<beach>
As the README says, the recommendation is to base the code on the core-math library.
<beach>
A library like this could be very useful in that it would provide correctly rounded math functions for new and existing Common Lisp implementations.
X-Scale has quit [Quit: Client closed]
kevingal has joined #commonlisp
coat has left #commonlisp [#commonlisp]
coat has joined #commonlisp
coat has left #commonlisp [#commonlisp]
coat has joined #commonlisp
wacki has quit [Ping timeout: 264 seconds]
msv has quit [Remote host closed the connection]
wacki has joined #commonlisp
X-Scale has joined #commonlisp
mwnaylor has quit [Ping timeout: 268 seconds]
jonatack has joined #commonlisp
jon_atack has quit [Ping timeout: 256 seconds]
jonatack has quit [Ping timeout: 264 seconds]
jonatack has joined #commonlisp
STEEW is now known as steew
mgl_ has joined #commonlisp
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
wbooze has quit [Remote host closed the connection]
mgl_ has quit [Ping timeout: 264 seconds]
wbooze has joined #commonlisp
dino_tutter has quit [Ping timeout: 268 seconds]
X-Scale has quit [Quit: Client closed]
random-nick has joined #commonlisp
waleee has joined #commonlisp
cmack` is now known as cmack
akoana has quit [Quit: leaving]
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 264 seconds]
skeemer has quit [Ping timeout: 256 seconds]
Psybur has joined #commonlisp
synchromesh has quit [Read error: Connection reset by peer]
synchromesh has joined #commonlisp
mgl_ has joined #commonlisp
yitzi has joined #commonlisp
josrr has joined #commonlisp
<jackdaniel>
what does it mean for the math function to be correctly rounded?
yitzi has quit [Remote host closed the connection]
<wbooze>
yeh
<wbooze>
there's c99 logic for rounding towards -inf or the others....
<beach>
I expressed that wrong. It means that the result of applying them is the closest floating-point value that can be represented, to the real value.
<jackdaniel>
I've gathered that much, but there are ambiguities to what does it mean to be closest to the real value; i.e specifying that float zeros are signed or not has an impact on that
<beach>
According to the core-math people, this is not the case for many existing libraries.
<wbooze>
yes, it's not
<jackdaniel>
Marco Antoniotti proposed writing such specification for Common Lisp