freenode/#lisp - IRC Chatlog
Search
0:40:27
aeth
The thing about this sort of config file is that no one writes it from scratch. There is one genesis file that just evolves over time.
0:40:54
aeth
I have tests in about half of my projects but I never got the CI working in any of them.
1:04:00
slightlycyborg
is there a single symbol let function that returns the symbol created after sideeffects?
1:06:24
aeth
no-defun-allowed: Oh I see what you did there. The examples all have make, but you just directly called SBCL instead of a make file. That's also why you asked about make
1:06:37
aeth
I had a .gitlab-ci.yml from a while back that I didn't commit yet and it had a make, which is unnecessary
1:07:20
aeth
no-defun-allowed: You might want to fail the CI if there are style warnings or compilation errors. You could verbose the quickload but that also makes... everything else verbose
1:08:48
aeth
So what I did wrong in my YAML from earlier is I had the wrong clone syntax and I was relying on a make file
1:15:13
aeth
make sure not to fail on notes because there are lots of stuff like "hey you're using rationals, we'd like if you didn't"
1:16:11
aeth
no-defun-allowed: You might want to turn on sb-ext:*derive-function-types* in your CI and in your build step in SBCL
1:16:33
aeth
That turns on full type inference, but at the cost of assuming that a redefined function must have the same ftype
1:18:19
no-defun-allowed
maybe i should put this in a script so i can just do `sbcl --script tests.lisp`
1:46:04
no-defun-allowed
aeth: i got an error: https://gitlab.com/netfarm.gq/netfarm/-/jobs/108420689
1:47:05
no-defun-allowed
it probably is sbcl putting out notes for other packages where SPEED 3 is used but idc
2:08:48
aeth
This is what I'm currently running: https://gitlab.com/zombie-raptor/zombie-raptor/blob/b90f23cf6168f892fce8fd980649eaf882662acb/.gitlab-ci.yml https://gitlab.com/zombie-raptor/zombie-raptor/blob/b90f23cf6168f892fce8fd980649eaf882662acb/tests/test-script.lisp
2:09:10
aeth
It looks like it finally works: https://gitlab.com/zombie-raptor/zombie-raptor/-/jobs/108423265
2:09:41
aeth
I'm not sure if the type errors would stop the job as a failure, though, because iirc they're just style-warnings, not errors
2:14:56
aeth
Hmm... It looks like, no, the type errors are caught at runtime in my tests, not at compile time.
2:35:43
stylewarning
slightlycyborg: it's a short way to say "if the argument is nil, move on, otherwise do what's in the brackets"
2:36:08
stylewarning
slightlycyborg: the designers of FORMAT were pretty well aware of the kind of use-case you're looking at: a function which returns useful stuff most of the time but NIL sometimes
5:45:33
jackdaniel
russellw: maybe with (defun reference (array &rest subscripts) (if (apply #'array-in-bounds-p array subscripts) (apply #'aref …) (error (make-condition 'out-of-bounds))) ;?
5:46:21
jackdaniel
if you do not care about portability, you may of course reach to implementation conditions if they exist
5:47:26
jack_rabbit
I'd be surprised there's not some library somewhere that has implemented implementation-specific checks for these error conditions.
5:50:15
jack_rabbit
I'm sort of surprised that a specific error type isn't specified for out-of-bounds conditions.
5:50:45
russellw
hmm! What about something like opening a nonexistent file? Is there any way to catch that?
5:52:55
jackdaniel
if you want something more specifc, then I can only propose similar solution to the one proposed before
5:54:36
jackdaniel
or handle file-error, access fire-error-pathname, check it out with probe-file and signal your own condition if it does not exist (otherwise resignal condition you have received)
5:56:54
russellw
Suppose you are generating errors yourself - say writing a parser, that must signal errors. For that, you could use handle-case and define a suitable error, right? But is there a reason not to just use throw and catch instead? That would seem simpler?
5:59:52
russellw
Oh yes indeed, there is a nice tutorial about it at http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html and it's good that all those features are there for people who need them. But all I need is the ability to throw and catch errors :)
6:00:31
aeth
I should correct myself, type errors are warnings, not style-warnings. But not compilation errors, either.
6:00:41
jackdaniel
I have this: https://lisper.in/restarts but I'm not sure if this is the one I have remembered being so good
6:01:13
jackdaniel
if all you need is throw/catch, then you need a throw/catch and claiming otherwise would be denying a tautology ;-)
6:02:29
aeth
jack_rabbit: That's a flaw in the spec imo. It's really random what kind of error you could see for common things.
6:03:02
jackdaniel
I've been debugging McCLIM internal mechanism (one of the downstream functions which does not have access to the screen - no medium argument)
6:03:28
jackdaniel
and I wanted to display a rectangle of the pixarray size (without disrupting computation)
6:04:18
jackdaniel
so I've defined a display-rectangle-condition and signalled it from this function. it was handled higher on the call stack with handler-bind, rectangle was displayed and downstream function working has been continued after that
6:04:41
jackdaniel
when I didn't want to handle it I've simply removed handler bind and despite being signalled condition was ignored
8:35:47
phoe
I have a string containing bytes in hex. What is the agreed way to convert that into a ub8 array?
10:48:22
no-defun-allowed
If you want that, Haskell has that by default. Even their wiki admits that's a bad idea for big strings.
10:50:06
jackdaniel
nly: array representation and list representation are different things in common lisp, but both are sequences
10:50:29
jackdaniel
some CL implementations provide extension called "extensible sequences" as well, to define your own sequence types
10:55:14
_death
you can also coerce a string to a list of characters, though that's usually not what you should want
11:03:50
no-defun-allowed
I solved the problem of not having a Netfarm MOP yet by using a hash table as an intermediate form for schemas.