Search
Thursday, 26th of March 2020, 21:57:38 UTC
22:02:16
Josh_2
Well anyway I have another issue along the same lines https://plaster.tymoon.eu/view/1722#1722
22:03:57
Josh_2
The form is printed fine, but when funcalled with 2 as the argument, instead of throwing an error it returns the value of byte
22:09:11
Josh_2
I do not understand why a condition is not signalled. in the example I sent byte is 1 not 2..
22:16:24
pjb
Josh_2: nope, this is not the error one gets: https://termbin.com/38mq You are using an undefined operator tlet, which leads to this error!
22:17:01
Josh_2
can just replace tlet with let and remove "integer"
22:18:03
pjb
Then, Works for me: https://termbin.com/lh29
22:20:00
pjb
Josh_2: you should debug subexpressions separately.
22:20:12
Josh_2
but byte is not equal to 2, why wouldn't it error?
22:21:10
pjb
Josh_2: (eq byte 2) is true.
22:21:14
pjb
Josh_2: only CL:NIL is false.
22:21:20
pjb
Josh_2: everything else is true.
22:21:58
pjb
Josh_2: https://termbin.com/t89i
22:23:40
Josh_2
I know that, but why isn't the form being evaluated
22:24:07
Josh_2
I know that (eq byte 2) is true, but why isn't (eq byte 2) being evaluated
22:24:47
Josh_2
That's my question basically
22:25:19
pjb
Well, it's not easy. You are wanting to build a form at run-time, and get it evaluated in a lexical scope. This is not possible directly in CL.
22:25:41
pjb
CL:EVAL evaluates in the global environment, not in a lexical scope.
22:26:25
pjb
But you can keep susbtituting, because the lexical scope is known to you, at program editing time. SO you can write the code that will substitute, not with 'byte, but with the value of byte!
22:26:55
pjb
(let ((byte 2)) (eval (change-byte '(eq :byte 2) #|no quote|# byte))) #| --> t |#
22:27:03
Josh_2
the value of byte is not known until the λ is funcalled
22:27:32
pjb
Then call change-byte at that time.
22:27:53
pjb
Now, if you prefer, you may generate a lambda-expression, and use eval coerce or compile to get a function.
22:29:03
pjb
But it won't be a closure. you must substitute into the lambda-expression all the values you need.
22:29:53
pjb
Now, since your function is named generate-<something> I would let it return the lambda-expression, and call eval, coerce or compile outside of it.
23:23:02
Josh_2
pjb: Thanks for the help :) I have it all working now!
0:13:58
amazoniantoad
Hi guys. Is there a way to suppress all warning from within slime?
0:20:18
Bike
all warnings from all lisp code at all? don't think so
0:20:40
dlowe
there might be, but it wouldn't be portable across implementations
0:20:41
Bike
you could wrap the repl with a muffler, i guess, but i don't think slime has that as an option
0:21:14
Bike
and it probably wouldn't effect compilation stuff so much
0:23:10
amazoniantoad
Okay. Just like, most of the warnings then?
0:23:22
amazoniantoad
I'm getting a very specific (and annoying) error
0:23:36
amazoniantoad
It is messing up my ability to read stuff because it kinda takes over
0:24:46
amazoniantoad
WARNING: unrecognized declaration (IGNORE ARG1 ARG2)
0:27:06
amazoniantoad
Sorry, not error. but a warning
0:27:21
no-defun-allowed
Where did you put that declaration?
0:28:09
amazoniantoad
inside of a function? I don't understand what you mean by where
0:28:11
amazoniantoad
Also nice username
0:28:11
Bike
it should give you a place the error is coming from
0:28:23
amazoniantoad
Oh, well I know where the errors are coming from.
0:28:36
Bike
did you shadow the IGNORE symbol, or something?
0:28:43
amazoniantoad
I am new to lisp. This is my partners code in an assignment. I'm just trying to suppress this warning
0:29:23
Bike
usually you fix the problem rather than suppress the warning
0:29:32
Bike
it looks like a simple one
0:29:47
Bike
if you paste some of the code, we can probably identify it for you, if you can't
0:29:58
amazoniantoad
I don't think he would like me sharing code. I'm sorry.
0:30:00
amazoniantoad
Thanks anyways
0:30:20
Bike
we're not going to steal his broken code :) maybe you should get him to fix it, then
0:30:44
amazoniantoad
He's done so much. I don't want to bug him, lol.
0:30:55
amazoniantoad
But maybe I should
0:32:26
Bike
well, i'm going to guess here, but wherever the (ignore arg1 arg2) line is, try replacing that with (cl:ignore arg1 arg2)
0:32:42
amazoniantoad
Thanks. I'll try that
5:22:34
beach
Good morning everyone!
8:10:30
aeth
Shinmera: Any chance of adding a NaN to float-features like you have infinities? There are many NaNs, of course, but I think any NaN would do when reading in a NaN from a file (or rather, a string representing the concept of "NaN"). It's just bits-single-float or bits-double-float with the right (wrong?) bits, I guess.
8:10:51
aeth
They also apparently have to be function calls, not constants, based on a conversation here a while back, maybe 4 years ago.
8:12:10
Shinmera
I suppose that's reasonable enough.
8:12:22
Shinmera
I won't implement it myself, but I'd be open to a PR.
8:13:14
aeth
e.g. (float-features:bits-single-float #x-4000)
8:13:24
aeth
I'm not sure I'd want to PR one line
8:13:55
Shinmera
There's documentation, testing, and more involved.
8:14:05
Shinmera
So definitely not just one line.
9:19:12
Lord_of_Life_
** NICK Lord_of_Life
Friday, 27th of March 2020, 9:57:38 UTC