freenode/lisp - IRC Chatlog
Search
15:19:34
buffalofrank
void_pointer: The Art of the Metaobject Protocol is another example with exercises :o
15:21:06
void_pointer
since I have been steadily running into a need to customize classes beyond what is doable just with the ANSI standard. That, and the MOP is pretty interesting as a whole
15:25:43
pjb
beach: What does "always" mean when the input data is fixed to D? Do you assume random internal functions, or unspecified input data?
15:26:14
void_pointer
beach: making some slots read-only (like struct), making others so they can't be changed eveh with slot-value to something without a validation function running on them first, etc.
15:27:14
void_pointer
beach: in principle, one can make wrapper types and use those for the slots, but that is a bit of a hack and seems brittle
15:28:00
void_pointer
beach: though I haven't tried it yet. Right now, I just am careful about making my own writers and not using slot-value outside of the package the class is defined in
15:28:52
void_pointer
basically, if I somehow manage to get an instance into a valid state, I want to make sure it can only change states to other valid states
15:30:53
void_pointer
only if one wants to go further and make it work for slot-value, would one need more
15:32:32
void_pointer
but also, it is useful for when others use the code. Easy to discipline oneself, hard to discipline others
15:33:04
void_pointer
but this is for a long ways down the road. Maybe in a year. For now, I just keep myself in line on the protocol
15:34:43
void_pointer
guess it is a bad habit of mine that I almost write more code verifying input and checking internal consistency than code that actually does stuff
15:35:03
loke`
beach: Wrt your never using SLOT-VALUE. I am of the same opinion, but I have ome exception: I sometimes use it in INITIALIZE-INSTANCE methods.
15:35:47
void_pointer
INITIALIZE-INSTANCE is an acceptable place to use it. After all, one already knows one's hands are in the fire
15:36:05
beach
loke`: I see. I tend to use reinitialize-instance instead. That way I am consistent with the protocol, which consists of accessors and initargs, but not slots.
16:05:20
kuwze
does anyone know how to get sly-mrepl to work with company? It looks like sly-company was integrated into sly, going by the repo
16:13:30
mfiano
kuwze: It does, assuming you have the proper company backend available in each buffer
16:14:08
mfiano
You could inspect the company-backends buffer-local variable, and ensure it has company-capf
16:17:35
jmercouris
phrased another way, how can I iterate through all objects for which char-codes returns an integer value?
16:19:56
mfiano
kuwze: No problem. If you need help configuring Sly to be more usable, you can take a look at the common-lisp-sly project, which is a Spacemacs layer I wrote when I was using such garbage (just google for it should take you to my github)
16:21:55
kuwze
I was surprised, it seemed like the author trashed it: https://github.com/joaotavora/sly-company/blob/master/sly-company.el
16:22:46
kuwze
like emacs lisp: https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html
16:22:50
mfiano
It was once an external linux package, requiring more work to integrate with Sly. Now, it's a first-class citizen with no configuration needed
16:22:59
kuwze
it seems to be defined http://www.lispworks.com/documentation/lw60/LW/html/lw-837.htm
16:23:19
kuwze
but company mode isn't showing any completions for defad... so what am I doing wrong?
16:23:20
dim
jmercouris: I just found sb-unicode::char-code-limit which might answer your question if you're using SBCL, see https://github.com/sbcl/sbcl/blob/e98378ca004ef6d101b384f6c3130f24b7a1bc1f/tests/unicode-misc.pure.lisp#L47
16:24:49
jcowan
jmercouris: The best you can do is iterate between 0 and (- char-code-limit 1), calling code-char on each, but being prepared to deal with char-code returning nil.
16:25:43
wusticality
Am I right in assuming that this channel is dedicated mostly to CL? Or are topics like Clojure ok to discuss
16:27:16
jmercouris
jcowan: let me describe what I'm trying to do, and tell me if you think this is a smart or a unsmart idea
16:27:30
jmercouris
(define-key *minibuffer-mode-map* (kbd "b") #'(lambda () (self-insert (mode *minibuffer*) "b")))
16:27:47
pjb
void_pointer: you need to check inputs only in public API functions. ("entry points"). Internal functions can assume correct inputs and types, since you will have proved them.
16:27:52
jmercouris
so I was thinking, it would be nice to write a macro that iterates through all of the supported chars and sets up a self-insert for minibuffer-mode-map
16:28:43
pjb
jmercouris: (loop for code below char-code-limit for ch = (code-char code) when ch do …)
16:28:49
jmercouris
however, with 1 million values on my machine, I imagine that will take some time...
16:29:31
sjl
wusticality: if you have questions about CL, or like "I would do X in clojure, how would I do this in CL?" those would be okay here. But if it's just general chat about Clojure, that would be ->#clojure
16:30:09
pjb
Nope, it's (+ (expt 2 20) (expt 2 16)) #| --> 1114112 |# a perfectly reasonable number.
16:30:49
jmercouris
but I don't imagine many people need to enter chinese characters into the minibuffer
16:31:21
mfiano
The lambda macro expands to (function (lambda ...)) which is the same as #'lambda, just less code. More importantly though, if you're in code position the macro will do the correct thing, or you're in data position and using #'lambda will expand to (function (lambda ...)) which is not evaluated. lambda may not even be cl:lambda so the expansion of (cl:function (pkg:lambda ...)) won't even be valid. So best
16:31:27
jcowan
No Unicode character will ever be assigned a codepoint higher than #3FFFF. (People who have bet against me on this, with a time limit, have always lost.)
16:31:28
pjb
(time (loop for code below char-code-limit for ch = (code-char code) when ch do (identity ch))) took 17,230 microseconds (0.017230 seconds) to run.
16:34:54
jcowan
Not a book, another Lisp language. It was to make ISLisp easily implementable in Common Lisp that the lambda macro (as opposed to ((lambda ...) ...) and #'(lambda ...) was added, almost at the last minute, to Common Lisp.
16:50:10
macaroni_destroy
Hi folks. I'm trying to solve this problem in hopes of helping to get SBCL added to the Kattis online judge. https://open.kattis.com/problems/different
16:54:57
beach
macaroni_destroy: Do you want a suggested solution, or do you want to work on it yourself for a while?
16:59:04
macaroni_destroy
I'd like a suggested accepted solution, yes. I'd also need to provide solutions that result in the various other judgement types, those being 'Wrong Answer', 'Time Limit Exceed', 'Output Limit Exceeded', and 'Compile Error'. They're interested in seeing the different ways the program for the program to crash or run out of memory, as well as what is
16:59:04
macaroni_destroy
safe to return to the user when it comes to output from a crashing program.
17:00:13
macaroni_destroy
I'm still learning Lisp myself, but trying to help get it added to more online judges, because I think they help a lot and are just nice for solving problems in spare time.
17:02:21
macaroni_destroy
Thank you. I'm making a git repo now with various types of submissions. Going to use these when turning in the results.
17:03:03
beach
(loop for first = (read *standard-input* nil nil) until (null first) do (print (abs (- first (read)))))
17:04:07
jmercouris
is a looping approach more memory intensive than using map on a list of objects?
17:04:19
jmercouris
are there any fundamental differences in CPU time and memory? or is it just preference
17:04:40
jmercouris
I guess it is implementation dependent, but I am asking the "in-general" question, whatever that means
17:04:47
beach
jmercouris: If you use MAP, you typically need to create a closure and invoke it several times.
17:05:15
sjl
If you can generate the objects as you go, a LOOP approach would let you avoid ever having to create the list all at once in memory.
17:05:44
pjb
jmercouris: Nothing prevents you to specify a given character set, and to iterate only over that character set. Nothing will prevent users to reject your software if it doesn't support unicode either. That said, if you write the software to drive a time machine, I wouldn't care at all if it used only ASCII.
17:06:57
jmercouris
I will time it, I'm actually quite interested to see how much of an impact it will have
17:09:34
jmercouris
mfiano: it went well, it is not nearly enough to cover the costs, I guess that will come out of pocket :D
17:10:14
jmercouris
beach: I'm so close to the dream that you described approximately a year ago with the lisp core and the separate gui process/framework communicating over IPC
17:10:38
jmercouris
I've grown so much in that time that I look over my old lisp code, and it makes me cry :D
17:19:40
macaroni_destroy
Well I'm going through all the variations of the programs provided, and for the one for output limit exceeded, I don't think I'm getting the appropriate response from the repl. Perhaps compiling it would yield different results? I'm running (loop (repeat 10000) (print "wow")) and getting "The function COMMON-LISP-USER::REPEAT is undefined".
17:22:00
jmercouris
macaroni_destroy: you can read about the loop macro here: http://www.gigamonkeys.com/book/macros-standard-control-constructs.html
17:22:29
jmercouris
macaroni_destroy: you were trying to invoke a function REPEAT with an argument of 10000, and since REPEAT is not a function, that's the complaint you got
17:41:19
dim
(defun sql-lock-waiting-p (waiting) (member waiting '(:nowait :skip-locked))) (deftype sql-lock-waiting () '(or null (satisfies sql-lock-waiting-p))) (defstruct sql-lock (strength nil :type sql-lock-strength) (table-name nil :type (or null string)) (waiting nil :type sql-lock-waiting))
17:44:20
dim
my goal is to simply define what I expect in some struct slots, here it's a member of a list of keywords
17:45:09
dim
for that I had to define a predicate function, then a type that uses it, and then assign the type to the structure... I don't guess it's possible to do something like :type (or null (member :a :b:c)) directly in defstruct?
17:46:26
macaroni_destroy
I have an accepted answer, wrong answer, time limit exceeded, output limit exceeded, and compile error. Any advice on how I could achieve a Run Time Error for the problem (https://open.kattis.com/problems/different)? I am trying to follow https://open.kattis.com/help/judgements#rte to understand how the online judge judges runtime errors.
17:47:56
macaroni_destroy
Also trying to achieve Memory Limit Exceeded (https://open.kattis.com/help/judgements#mle). :P
17:48:49
jmercouris
if I manually write define-key for each key code it works properly, if I do it in a loop, everything is set to the last value in the loop
17:49:28
dim
macaroni_destroy: (handler-case (main-code-here) (condition (e) (format *standard-error* "~a" e) (uiop:exit 1))) at the top-level might get you covered?
17:50:27
dim
jmercouris: loop creates a single binding (ch here) that is assigned the values one after the other, and you keep changing the binding, and everything points to that binding...
17:51:48
jmercouris
that's what perplexes me about it, I'm getting the value of the binding at that time, not using the symbol or anything
17:53:55
dim
jmercouris: yeah but I think the do block in your loop exists only once, you can see that when expanding the loop (macroexpand-1 '(loop ...))
17:54:26
dim
macaroni_destroy: yeah, capture anything that might happen with handler-case and exit 1 in that case, that's your run-time error right?
17:59:02
dim
beware that it will shutdown your lisp process, so kill your Emacs SLIME session if you're using that
18:09:53
pjb
macaroni_destroy: sbcl compliant is not a notion. You can choose to write conforming code, that will run on all conforming CL implementation the same way. Or you can choose to write implementation specific code, which is unintersting to me.
18:10:25
pjb
macaroni_destroy: there's no quit or exit in Common Lisp. Once you start CL, you remains in CL forever.
18:33:09
macaroni_destroy
I think the last thing I'll need is a program that generates a Memory Limit Exceeded error and "a list of the Ubuntu packages for the language that needs to be installed, what directories needs to be available in the sandbox for the language to work well, and a reasonable set of compiler and runtime flags for competitive programming"
18:33:46
macaroni_destroy
As far as particular compiler flags for optimization, I'm a bit stumped there.
18:34:23
puchacz
hi, can I write something like (my-function :size <value-indicating-using-default>) ?
18:35:11
macaroni_destroy
This was the email I got from them, if anyone wondered, so I would guess I'm almost done providing everything https://0bin.net/paste/QdhVj5DR8zDDmM4a#L6T+U8M8V4aHTXyR+VFwoTUyMYMx4QYPXDf6YHQauLD
18:35:55
macaroni_destroy
I'm going to donate to their patreon once I've submitted everything to them so there's extra incentive
18:36:23
puchacz
anamorphic: but I would like to call it with :size, but for certain values I want it to use default
18:36:59
puchacz
so I would have a code (my-function :size size-passed-from-surrounding-code) without any conditionals
18:37:57
puchacz
(defun my-surrounding-function (&key (size 30 size-provided?)) ... (if size-provided? (my-function :size size) (my-function)))
18:40:41
anamorphic
(let ((*size* 30)) (my-surrounding-function)), where (defun my-surrounding-function (&key (size *size*)) .. (my-function)) where (defun my-function (&key (size *size)) ...)
18:42:31
trittweiler
puchacz, (apply #'the-function `(1 2 :foo 23 ,@(when size-p (list :size size))))
18:48:08
trittweiler
puchacz, One another way is to make sure that NIL will be interpreted as the default value to. So in your my-function make sure that you use (or size 30) at the appropriate place
18:52:09
macaroni_destroy
What are some ways to allocate a lot of memory in SBCL? Let's say I wanted to allocate more than 1024MB.
19:00:30
macaroni_destroy
shka_ I'm talking about the simplest program that can allocate 1024MB. Are you saying SBCL can not run programs that grow that large in memory, while running, by default?
19:08:53
macaroni_destroy
going to step out for a moment and will be back to try to make a simple program that can grow past 1024mb
19:19:50
dim
it just feels strange that symbols from any package would "magically" work with loop, and also that would intern all those symbols in the package too, well, I think?
19:51:22
frgo
Hi there. Anybody here having experience with cl-autowrap? I need to pass a "-DFRGO=1" to c2ffi - How would I do that with autowrap? Thx for any hints!
20:16:32
jcowan
sjl: "Sometimes things aren't abandoned, they are just finished." 2015 is not particularly long ago in Lispworld.
20:16:59
sjl
jcowan: Yeah, but the point of mocl was to interface with iOS/android. Unfortunately those move a lot faster.
20:34:12
me`
Back in my day, we would keep our eyes open all day for a honey bee swarm. A swarm is when a nest of bees gets so large that part of the population leaves with a new queen to form a new colony.If you saw a swarm on a tree branch you could cut the branch and literally shake them off into a box so you could later have your own bee hive. But I always shook mine off into a crudley constructed wooden dildo and shove it up my ass. That's what
20:34:24
me`
Back in my day, we would keep our eyes open all day for a honey bee swarm. A swarm is when a nest of bees gets so large that part of the population leaves with a new queen to form a new colony.If you saw a swarm on a tree branch you could cut the branch and literally shake them off into a box so you could later have your own bee hive. But I always shook mine off into a crudley constructed wooden dildo and shove it up my ass. That's what
20:46:17
no-defun-allowed
(reminds me of the 4chan guy who had a bunch of snails doing a similar thing. Don't look that up.)
21:53:10
aeth
Is there any way to get just the final count of notes/warnings/errors/etc. without getting the full :verbose t in Quicklisp?
22:14:04
pjb
or you can use gensyms too: (loop #:repeat 10 #:collect 'foo) #| --> (foo foo foo foo foo foo foo foo foo foo) |#
22:15:25
pjb
Notice however that the interning of symbols is done at read-time, which usually occurs at compilation-time and that the compiler "throws away" those symbols. They won't be present at run-time (when you load the compiled files in a fresh image).
22:17:41
aeth
If loop was its own language, emacs would highlight for, repeat, collect, do, in, across, etc. Since it's just a macro you have to do :for, :repeat, :collect, :do, :in, :across, etc. if you want the highlighting
22:18:23
aeth
Complaining about keywords is like complaining about parentheses imo. Eventually you get used to the syntax and you no longer see ":foo" you see "the keyword foo"
22:19:20
aeth
on_ion: Emacs always highlights :foo so by using keywords in macros the "keyword" part is instantly apparent
22:19:40
on_ion
aeth: yeah =) but i mean for the loop to work, of course it works with keyword symbol right? silly question
22:20:05
on_ion
ah, yeah. to add similar topic, i think it is just fine if emacs were to highlight the first element of any sexp list
22:20:41
aeth
Yes, but apparently iterate doesn't work with keywords, so loop is actually better than iterate there. Everyone :uses CL so you don't really notice, but since :use on a package is discouraged, you do notice with iterate, since you shouldn't :use :iterate
22:20:51
on_ion
as for :keywords watch how i start typing english with it on the wrong :side the reckoning
22:21:46
aeth
In case I'm unclear, the only reason it's *not* inconvenient to use regular symbols in LOOP even if it only accepted its own symbols and not keywords is that you're importing every symbol from the CL package.
22:22:01
aeth
In general, you want keywords for that sort of thing if you're not going to accept symbols from any package
22:22:17
on_ion
i have a feeling that some parts of emacs, scheme or cl or slime or redshank or lisp-mode or something, does this sometimes
22:23:37
aeth
on_ion: I think it's a mistake to think of programming like writing English. It's best to think of it as its own language that happens to borrow some words from English, although sometimes the words have a different meaning (e.g. vector).
22:29:44
aeth
pjb: The parts specified in Common Lisp's hyperspec borrow some words from English, and invent some creative new words like rplaca, too
22:30:20
on_ion
'whereas for trains, car is used for elements after the engine, in the case of lisp...'
22:31:55
on_ion
(apparently when trains were big all over the world it was big things with train stations)
22:35:12
aeth
Besides, if that wasn't the case, then the caddd...dr pattern wouldn't hold. That assumes a proper list.
22:43:27
macaroni_destroy
So (make-array (1+ (expt 1024 3)) :content-type '(unsigned-byte 8)) should be sufficient to make a program that uses more than 1024MB of memory?
22:44:13
no-defun-allowed
iirc on linux it doesn't really allocate until you touch it but maybe :initial-element 0 will help
22:44:42
White_Flame
yeah, SBCL has a fixed heap size, with cmdline parameters to set a different max
22:45:49
macaroni_destroy
If I wanted to initialize each element to 0, to ensure that I use that memory, how would I do so? :)
22:45:54
White_Flame
ooh, the spec allows for undefined behavior of reading uninitialized array slots
22:47:05
macaroni_destroy
(make-array (1+ (expt 1024 3)) :content-type '(unsigned-byte 8) :initial-element 0)
22:51:57
macaroni_destroy
i'm trying to make a program that would exceed the memory limit of 1024MB for https://open.kattis.com/problems/different
22:52:39
macaroni_destroy
in hopes of passing it and a couple of variants of the program (like the accepted solution) on to the kattis team so they can add sbcl as an official language
22:55:14
macaroni_destroy
so I should be able to run the program with `sbcl mem_limit.lisp --dynamic-space-size 1024`?
23:01:03
macaroni_destroy
ok now that i have all the variants of solution to that problem -- accepted, wrong answer, time limit exceeded, run time error, memory limit exceeded, output limit exceeded, and compile error, I can get to writing up some things about what a lisp sandbox would look like for the language to work well for competitive programming
23:01:42
macaroni_destroy
in terms of compiler optimizations, are there any special flags used for speeding sbcl up?
23:05:51
macaroni_destroy
"We would also need a list of the Ubuntu packages for the language that needs to be installed, what directories needs to be available in the sandbox for the language to work well, and a reasonable set of compiler and runtime flags for competitive programming."
23:06:31
macaroni_destroy
I don't think there are any special directories that need to be available for sbcl to work well.
23:07:13
macaroni_destroy
Perhaps flags, if this is a flag, is just making sure that the heap is set to an appopriate amount, like 4096 linked above?
23:08:18
macaroni_destroy
Hmm I guess I should look up how to make a compiled sbcl program, because `sbcl --d-s-s 4096 --load memlimit.lisp` likely is only for the interpreter, right?
23:18:37
aeth
the raw link might be better for opening in Emacs: https://gitlab.com/snippets/1776926/raw
23:19:46
gendl
Hi, what is a good way to understand ASDF output-translations. I'm a bit boggled. My source directories are symbolic links, and this appears to be completely messing up the output-translations (the output-files are ending up in the hierarchy of the link target, not the local hierarchy)
23:20:42
gendl
everything was working fine until I replaced my source directories with symbolic links. I'm trying to adjust the output-translations to deal with it, but utterly failing to understand how they are supposed to work...
23:21:56
aeth
jcowan: I believe the real issue is when there's a future name conflict. So if foo now exports foobar and you already are using foobar from another package (instant import name conflict and now you have to do shadowing) or defining your own foobar (you ideally get a compilation warning, but now what happens (afaik) is you just redefined foo:foobar rather than properly having a your-package:foobar)
23:23:01
jcowan
Yes, that's name pollution: you get access to names you don't know or care about, and when you try to use them yourself, BONK (or worse yet, no error, as you say).
23:23:34
aeth
It looks like when I try to define my own factorial in a package that uses alexandria in SBCL I get "Lock on package ALEXANDRIA.0.DEV violated..." instead of a warning.
23:24:47
macaroni_destroy
no-defun-allowed: ok since java uses the following flags on kattis -XX:+UseSerialGC -Xss64m -Xms{memlim}m -Xmx{memlim}m -Dfile.encoding=UTF-8 -cp {path}
23:25:38
aeth
In ECL, I can do (ql:quickload :alexandria) (use-package :alexandria) (defun factorial (x) x) (alexandria:factorial 42) => 42
23:27:15
macaroni_destroy
no-defun-allowed going to ask them to allow sbcl to use `sbcl --dynamic-space-size {memlim} --control-stack-size 64 --script {path}`
23:29:18
gendl
ok. the issue isn't really with output-translations, it's with the system registry following symbolic links (which I guess is what it's intended to do..)
23:34:58
aeth
pjb: I was expecting the SBCL redefine function warning, but I actually got a package lock error, which I guess is even better for catching this kind of redefinition bug.
23:36:38
aeth
pjb: try (ql:quickload :alexandria) (use-package :alexandria) (defun factorial (x) x) (alexandria:factorial 42)
23:38:17
aeth
pjb: and in CCL I get #.(format nil "Using #<Package "ALEXANDRIA.0.DEV"> in #<Package "COMMON-LISP-USER"> ~%would cause name conflicts with symbols inherited by that package: ~%ALEXANDRIA.0.DEV:COPY-FILE COPY-FILE")
23:39:08
aeth
#.(format nil "Using #<Package \"ALEXANDRIA.0.DEV\"> in #<Package \"COMMON-LISP-USER\"> ~%would cause name conflicts with symbols inherited by that package: ~%ALEXANDRIA.0.DEV:COPY-FILE COPY-FILE")
23:39:40
no-defun-allowed
aeth: well LOCK-PACKAGE and UNLOCK-PACKAGE live in sb-ext, and i couldn't find any mention of package locks in the CLHS
23:40:56
aeth
no-defun-allowed: Ahah! Looks like it has "#+sb-package-locks (:lock t)" and CCL pretends to be SBCL there to also read that lock
23:41:09
aeth
https://gitlab.common-lisp.net/alexandria/alexandria/blob/408ff1d6ffd48d204b9165d175c1afb1d1dd585f/package.lisp#L4-5
23:41:33
pjb
aeth: one reason more why not use sbcl. If you can't redefine your function, it's useless.
23:42:43
pjb
ccl doesn't pretend anything: you're using alexandria in a package that has already a copy-file symbol!
23:46:43
aeth
Looks like this test could be used: (ql:quickload :alexandria) (defpackage #:foo (:use #:cl #:alexandria)) (in-package #:foo) (defun factorial (x) x) (alexandria:factorial 42)
23:50:21
aeth
pjb: So you're basically saying "Just perfectly understand the full system and everything is fine"
23:51:09
aeth
My point is, in modern software, even in CL, it's impossible to understand the entire environment you're using.
23:53:07
dim
it's more than we assumer our coworkers and lib authors to not be adversarial, in general
0:21:39
aeth
So I'm thinking about doing this for types for destructuring binds: (:destructuring (foo bar (baz quux)) (fixnum cons (integer vector)) list)
0:22:57
aeth
T would mean don't check-type/type-declare that particular thing (i.e. it's of type T). NIL would mean that part of the destructuring bind has no check-type/type-declare. So (foo bar nil) would be valid as would nil, but (foo bar t) or t would be invalid for that particular example.
0:27:07
aeth
For options what I'll probably do is have a special (:options ...) item as an optional first "binding" so you can configure between check-type or type declarations. So it could be: (with-bindings ((:options :check-type t) (foobar integer 42) (:destructuring (foo bar (baz quux)) (fixnum cons (integer vector)) some-list) (:values (x y) (integer double-float) (floor 42.5d0))) ...)
0:28:27
aeth
The downside with this new flatter syntax (the old style would have been ((foobar integer) 42)) is that if you just want the ultra-binding with no types you'd have to say (foobar nil 42) or (foobar t 42) but I guess that means yet another macro, then. (6 total, then?)
0:30:30
no-defun-allowed
ACTION uploaded an image: Screenshot_2018-11-12_11-25-23.png (35KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/iTMDfIWxvHpKVsexcaXNPoao >
0:30:33
aeth
Oh and I think I'm going to go with (:values (x y) ...) instead of my original idea of copying SETF and using ((values x y) ...) just so there's a clear distinction between regular bindings and bindings that are fancy, i.e. each binding either begins with a symbol (treat it like a typed let) or a keyword, where the keyword is the fancy type of binding
0:32:56
aeth
So you can't actually implement Common Lisp on a 16 bit machine using traditional implementation techniques, but the minimums are essentially made with 16+ bits in mind, not 32-64
0:34:32
aeth
I'm guessing at the time they assumed there'd be 16-bit microcomputer Lisp machines that were actually at least 17-20 bits?
0:36:44
aeth
Strange that they didn't raise the minimums in the 1994 standard, or if they did that they kept them so low.
0:43:54
aeth
I think the correct thing to do is to have three separate standard minima, for each bit size: 16, 32, and 64.
0:44:33
aeth
Then you only need to know that you're using a 64-bit implementation and can then safely assume that e.g. docstrings can be longer than 1024 characters long
1:14:58
elderK
Going to rewrite my "epidemic" thingy today. To apply some of the feedback you guys gave me.
1:15:29
elderK
It'd be nice for instance, if I had a conditional increment, without having to write when all the time.
1:38:08
jcowan
aeth: Scheme set the minimum fixnum limit to 24 bits, but that only affects the correctness of fixnum-specific operations, it does not constrain things like the sizes of strings. I wasn't there, but I assume 24 bits = 32 bits/word - a maximal 8-bit tag.
2:17:24
loke`
elderK: Well, that's your problem right there. How else would you do Lisp development without an easy way to compile functions, etc.
2:18:40
loke`
I can't even imagine what a nightmare it would be to develop in Lisp without Emacs. How would you even do it? You'd end up writinf code, and then manually load and compile eveeyr time. Probably restarting the runtime over and over again.
2:19:21
elderK
LdBeth: Now that I've defined a couple macros, is there anything special I need to do to make sure like, everything works? Like, I've heard of eval-when.
2:20:18
aeth
jcowan: In CL, I think that "everything" in this category (e.g. array indices) has to be a fixnum and these things are normally positive, so in effect if fixnums are 2 ^ n then the upper bound for things like array-total-size-limit would be 2 ^ (n - 1) - 1. In SBCL, array-total-size-limit is 2 ^ 62 - 3. In CCL, though, it isn't anywhere close to the theoretical maximum iirc.
2:22:05
LdBeth
elderK: it's usually a good practice collecting macro definitions in one place and load them first
2:22:35
aeth
In practice they seem to have given extra room, so e.g. array-total-size-limit is 2 ^ 10 even though most-positive-fixnum has to be at least 2 ^ 15 - 1
2:24:28
aeth
You only need eval-when for helper functions called by defmacro located in the same file as the defmacro iirc.
2:24:37
macaroni_destroy
welp submitted this to kattis team. hope they will add sbcl https://github.com/optimisticlisper/kattis_sbcl_different
2:25:11
no-defun-allowed
aeth: regarding the gitlab-ci stuff, you may not need git since it clones into a subdirectory of /builds/
2:25:40
LdBeth
aeth: in CCL not warp macros in eval-when could cause problem expending macrolet form
2:25:58
aeth
no-defun-allowed: instead you can just ln -s that directory to make sure it shows up in ~/quicklisp/local-projects/
2:26:22
aeth
no-defun-allowed: I think that git is used in the recipe so that you can have dependencies that require being downloaded from git.
2:30:13
LdBeth
the example is (some-macro (macrolet a b c)) where the argument form is just a list of symbol but ccl tries to expand it if some-macro defined in the same file is not warped in eval-when
2:30:40
aeth
no-defun-allowed: I would probably just comment out the part that requires git rather than removing it because once you need to load a dependency that is either not in Quicklisp or newer than the latest version in Quicklisp you're going to need it back in.
2:34:28
aeth
LdBeth: Perhaps there's a problem with order where if a defmacro foo is located below where it's used in the file CCL complains?
2:34:44
aeth
LdBeth: I definitely use macros in the same file where I define them all of the time with no problems
2:49:38
LdBeth
aeth: the actual situation is a little complex, the problem occurs when I use a custom code walker that idex symbols after macroexpand, and somehow ccl treats macrolet differently than sbcl that it tries to expand that form
2:55:10
LdBeth
Bike: function-information or something on ccl give different thing for macrolet than sbcl