freenode/#lisp - IRC Chatlog
Search
12:12:54
beach
OK, I created an appendix describing how I plan to adapt Doug Lea's allocator to SICL. I would appreciate if y'all would take a look. It is the first draft so far, and I will likely work on the details later: http://metamodular.com/allocator.pdf
12:29:08
edgar-rft
I don't think it rally matters what acronyms like WRKZTG really mean because people using such things don't show the slightest interest to be understood by others, so their opinion should be totally ignored.
12:32:47
Bike
i'm just imagining that beach types like a champion texter, but we can't tell because of all the abbreviation expansions
12:32:55
beach
I mean, when I type (say here in IRC) "gme", it expands to "Good morning everyone!", and when I type "hs" it expands to "Common Lisp HyperSpec", so I don't need to expose other participants to such abbreviations.
12:33:32
edgar-rft
beach: what if I wrote my doctioral thesis with vim? would emacs abbrevs expanded there?
12:34:11
shka1
"Forgetting how to implement a Prolog system is as hard as learning how to build one."
12:37:11
edgar-rft
beach: My original rambling was about abbrevs like AFAIUI in text intended to be read by humans. Of course I have no problem if anyone uses the capabilities of his/her editor to make life less painful, as long as I don't need to read unexpanded abbrevs like AFAIUI in plain text.
12:38:03
beach
I just pointed out an easy way to avoid that, without having to manually expand those abbreviations. But I take it very few people use that way.
12:39:09
edgar-rft
Many people like tp use computers to make life *more* complicated than otherwise around.
12:58:19
pjb
https://www.emacswiki.org/emacs/AbbrevMode https://www.gnu.org/software/emacs/manual/html_node/emacs/Abbrevs.html
12:58:41
pjb
I'm lazy, I've been using emacs for at least 26 years, and I never had a look at abbrev…
13:01:04
malice
Hi! Macro question: I'm struggling with creating this macro. Here's my effort: https://pastebin.com/4t0mGHaB
13:01:07
malice
The macro is basic with simple twist: it defines another macro(with macrolet) so that I don't have to pass the variable (parser) all the time in there.
13:01:28
malice
However, I get errors and I'm not sure how to get it right. The error is either "variable parser is unbound" or "variable parser-name is unbound"
13:01:57
malice
parser is unbound if parser-name is double-unquoted, parser-name is unbound if parser-name is single-unquoted
13:02:39
shka1
malice: i have this issues all the time, just use ,', instead of ,, for variable name
13:04:43
shka1
malice: https://github.com/sirherrbatka/cl-data-structures/blob/252fa0442dfc2c28b4075d96ba63339be9ebe502/src/utils/macros.lisp#L311
13:06:41
pjb
malice, it's not obvious that previous needs to be a macro. If it was a flet, you could call the outter previous function from an inner previous function with a different signature.
13:08:51
malice
pjb: I wanted to avoid it overwriting the function slot of the previous since I wasn't sure if that wouldn't affect other functions that call it
13:13:02
pjb
beach: after having read (only) C.1 we don't understand why the in-use bit is stored in the next chunk. And the diagrams don't even show the next of the next chunk, so the information displayed is incomplete.
13:13:53
pjb
beach: what use are the chunks that don't have free space in them? bin 0 seems useless.
13:21:15
beach
Only free chunks have 4 words with valid data. A chunk in use has only 1, so there are 3 words for user data.
13:22:24
beach
The in-use bit is stored in the next chunk so that when a chunk is freed, you can check whether the previous chunk is in use. If it is not in use, the previous word is the size and you can use it to find the beginning of the previous chunk.
13:22:59
beach
If it is in use, you can't do that because the size field is then used by user data, so you must have this bit to check which case it is.
13:26:29
beach
pjb: I have yet to write the section on freeing a chunk, so it is normal that this is not clear from the current document.
14:16:11
beach
Interestingly, since these chunks are going to be used for the racks, and many racks need a size stored in them (like for arrays), I can sometimes use the size field of the chunk instead of storing the size separately.
14:50:43
montxero
someone has a gun to your head and says, show me a simple example of a macro in under 7 lines! It must be simple enough for a non lisper to understand once some basic rules are explained
14:54:42
beach
Sure, prog1 will do. (defmacro prog1 (first-form &rest more-forms) (let ((result-var (gensym))) `(let ((,result-var ,first-form)) ,@more-forms ,result-var))) something like that.
14:54:58
trittweiler
montxero, how about (defmacro while (condition &body body) ...)? There are many ways you can base the expansion on. Which one depends on your intended pedagogy.
14:58:46
loke
When I deonstrated macros to a non-Lisp audience I created a reverse-if, basically something that worked like IF but reversed its arguments: (IF C T F) ⇒ (REVERSE-IF C F T)
14:59:42
beach
montxero: I don't think you are ever going to be happy with the answer, so I give up.
15:01:05
loke
I still have the slides from that presentation: https://docs.google.com/presentation/d/1mIHAruC3nbI-CZPVjX7AuRp-bj9xjJima0l6XrHUI6Y/edit?usp=sharing
15:07:09
montxero
beach: How about this... BANG! now I've shot the tip of your right shoe missing your toes by inches... c'mon gimme one
15:08:31
loke
beach: It is another CAS, separate from Maxima, although the maintainer of Maxima started the Axiom project as well, back in the 70's or something
15:09:25
loke
It's still maintained, which is fine (but odd that I didn't know about it). It runs in Common Lisp, but it's written in lterate style (like Knuth does) and it seems as though they actually don't write the code in Lisp, but rather in the Axiom language that is converted to CL.
15:10:01
loke
The source files bascially contains the axiom code in comments + the CL code. it seems they pass it through a translator that converts the axiom code in the comments to respective Lisp functions.
15:11:03
loke
It's a bit strange, but at the same time perhaps a good example of how you can leverage Lisp to get natively compiled Lisp code even if you use a different language.
15:12:18
loke
wonder how this is maintained. Dothey write the code in comments, or do they paste the result manually after making modifications?
15:15:29
loke
I'm looking at some changes in the git history. The git change records a change to oboth the code in the comment, along with the corresponding Lisp code in the same diff
15:23:28
makomo
but there's an interesting talk from one of the the authors (and the current maintainer) on literate programming
15:55:51
oni-on-ion
this tripped me out yesterday, it is one of two things ive seen yesterday which really opened my mind and respect for lisp : http://www.lispology.com/show?JHE
15:59:28
beach
oni-on-ion: That one doesn't take into account the published results that write floating point numbers so that reading it back gives the same exact value.
16:26:03
fouric
does anyone know of a macro that expands into the line number that the macro is placed at, and for bonus points, the name of the file, too?
16:28:09
fouric
which i was hoping to avoid, but if it's the only reasonable/portable option, then i'll take it
16:48:23
Xach
fouric: other implementations have something similar. swank papers over the differences to be portable.
17:20:39
_death
(defun ~-reader (stream char) (let ((*package* (find-package "KEYWORD"))) (read stream t nil t)))
19:41:55
didi
Is there some kind of hook in SBCL or SLIME that runs after a form is evaluated in the REPL?