freenode/#lisp - IRC Chatlog
Search
16:49:20
phoe
Is there any CL library or implementation function that will help me simplify types as much as possible? I have a compount type such as (not (or (not (cons (eql 0) (real 3d0 3d0))) (not (cons t (eql 0))))) and I would like to make it simpler to parse.
16:51:03
phoe
Yes, that's where I am looking right now. The only thing I found in CCL is something that operates on its internal ctype representation, not on CL types.
17:09:01
pfdietz46
You might want to look at Jim Newton's PhD thesis, which he defended this summer. https://www.lrde.epita.fr/wiki/Affiche-these-JN
17:28:59
pfdietz46
There are also complexities from negative zeros, which are = but not EQL to positive zeros of the same float class
17:31:49
pfdietz46
I have a random tester for subtypep that tries various combinations that should be equivalent. Does that repo have random/random-types.lsp?
17:34:55
pfdietz46
It's ok in complicated systems for subtypep to return nil, nil. Make sure it's not doing that.
17:36:37
pfdietz46
You can find random/random-types.lsp in my ansi-test repo on GitHub. Let me check if it's public.
20:38:08
jeosol
Is any one using some CL lib for literate programming. I am trying to write some documents, but capture the output of repl -- mostly formatted output, tables, etc. No lisp code
20:38:14
mooch2
um, i'm currently trying to write a multi-system emulator in common lisp, starting with the nes. is anybody interested in maybe helping me?
21:30:01
jeosol
rumbler31: I am trying to create some blog post using markdown and export everything to html. I would like to capture output of my program that's dumped to the repl. I do that manually, but wondering if there are automated techniques like using org-model + babel (not an expert in this but seen a few videos)
21:32:30
jeosol
rumbler31: not what I mean. I mean like certain outputs just go to certain sections of the markdown documents. The example I cited (some YT tutorial) captures shell or python output from code blocks or something.
21:39:20
pjb
jeosol: yes, I'm using the CL library to do literate programming. The CL library contains the operator #| that introduces text, and |# that introduces code.
21:40:50
pjb
#| for example, let's define a function named square: |# (defun square #| that takes one argument: |# (x) #| and compute the square: |# (* x x)) #| note how code is brackeded with |# #| ! |#
21:41:11
p_l
mooch2: wish I could help you out, but I'm too busy with work at the moment to even write a line of code for my Ivory emulator (right now more of a dissector)
21:41:37
pjb
jeosol: also, notice how emacs knows that it should fontify only the code between |# … #| and not the text.
21:41:55
jeosol
That is the link. I have no affliation with the author and watched that video after it was posted on the emacs reddit link
21:42:16
pjb
jeosol: notice how compile-file, load and read are literate-programming ready: they only process the code!
21:42:37
jeosol
pjb: Thanks for your info. I am not an expert in this at all, but noticed it will allow me to organize my files together with the examples.
21:45:14
pjb
To invoke the literate programming library, you just start the file with #| and end it with |#.
21:46:48
p_l
*if* you do some creative work with readtable you can get it to output the text and push it through some other formatter
21:47:01
pjb
#| for example, let's define a function named square: |# (defun square #| that takes one argument: |# (x) #| and compute the square: |# (* x x)) #| note how code is brackeded with |# #| ! |#
21:47:34
p_l
not sure how well it would work for manipulating both code and text for purposes of generating printed document that had both
21:48:08
jeosol
@p_l: that sounds like what I am looking for like the linked YT video. Not sure it's possible though, I wanted to see what people are using
21:49:02
jeosol
I want to type markdown, and somewhere in the document, I can have lisp code (and comments) to help me remember what cases or functions I called ( I don't have to show the lisp code), but the output gets generated into the document
21:50:45
pjb
https://www.offerzen.com/blog/literate-programming-empower-your-writing-with-emacs-org-mode
21:53:23
PuercoPope
jeosol: There is a erudite for literate programming although its more for writing and finding your way about the code that presenting it https://bitbucket.org/mmontone/erudite/src/master/
21:58:22
PuercoPope
Not for documentation but to provide a superstructure to the code, outlines in this case. You can check mariano's fork of scenic to see how erudite is used.
22:03:57
jeosol
pjb: Checked the link and I think there is CL support and that org-mode route should work.
22:11:41
Josh_2
Using the python one from this site http://urlregex.com/ works with two escape characters
22:17:35
aeth
jeosol: The reason #| ... |# works for literate programming is because you can just write a second parser and effectively you parse the file twice, once as a document and once as a program. Parsing it as a program is, well, it's just using the default reader and it will run, no magic required since it's just the comment syntax. Parsing it as a document means you read it as an extended Markdown or LaTeX or whatever.
22:19:16
aeth
Essentially, you can just preprocess it for an existing Markdown->HTML generator and invert the comments in that preprocessed step. So "|# ... #|" would become "`...`" if it's "inline" and if it's multiline it becomes "```common-lisp\n...\n```"
22:20:50
aeth
You could probably do this with regular expressions if you're careful about the edge cases (like the first comment where there's either a "#|" that needs to be removed if it starts with a comment or a "... #|" that needs to be turned into lisp followed by markdown without having a first |#)
23:37:09
saturn2
where can i find examples of some of the CLtL2 features (macroexpand-all, compiler-let, variable-information, parse-macro, enclose, etc.) being used?
23:54:03
saturn2
yes i can come up with some ideas myself, but surely people smarter than me have thought about this before
23:54:57
Bike
https://github.com/guicho271828/inlined-generic-function is the only library i can think of using them
0:58:22
vms14
I ended using a lot this one (defun make-text-buffer () (make-array 0 :adjustable t :fill-pointer t :element-type 'character)) and the html functions I've made with a bad implementation that return html code
1:42:25
White_Flame
recurses through all CARs of nested lists, as well as the last element of an improper list
1:46:37
Colleen
Unknown command. Possible matches: 8, help, set, say, mop, get, time, tell, roll, deny,
1:48:19
vms14
https://stackoverflow.com/questions/43989257/how-to-export-all-definition-symbols-in-a-file-in-common-lisp
3:23:51
oni-on-ion
https://quickref.common-lisp.net/alexandria.html#go-to-the-ALEXANDRIA_003cdot_003e1_003cdot_003e0_003cdot_003e0_003ccolon_003e_003ccolon_003eNCONCF-macro
4:11:01
equwal
""The GENERIC-CL-USER package is also provided, which contains all the symbols in the CL-USER package" -- don't do that.
4:11:32
equwal
"This package is intended to be used only at the REPL" -- now I really don't see the utility.
4:12:21
oni-on-ion
hmm i don't see the purpose of these comments. it just sounds like its not for you