freenode/#lisp - IRC Chatlog
Search
15:53:56
pfdietz
It's a context-aware diff/merge tool, working on ASTs from various sources. For Lisp, it uses ASTs produced by Eclector.
16:19:30
beach
Speaking of extracting stuff, would there be a "market" for an extracted Common Lisp printer? I.e. would such a thing be possible to incorporate into existing Common Lisp implementations. In particular would it be possible to incorporate it into implementations written in C or C++, or would they need a printer written in the host language anyway?
16:20:43
jmercouris
if I define macroA which expands to something that includes macroB, but macroB has not been yet read
16:23:22
beach
There is already a portable pretty printer that I assume most implementations are using. I have a near-complete FORMAT for SICL, but this time I was thinking more of PRINT-OBJECT, PRINT, etc. and the printer variables.
16:23:29
jackdaniel
jmercouris: if you wrote macro-a which expands (macro-b something), and macro-b is not defined yet when you type (macro-a), then it will expand to (macro-b something) and treat macro-b as function
16:24:07
dlowe
jmercouris: it's specifically documented http://www.lispworks.com/documentation/HyperSpec/Body/03_bcaa.htm
16:24:33
jmercouris
so here's the thing, if I manually expand the macro myself in the repl twice, it works
16:24:57
Bike
So the idea here is that define-parenstatic and define-command are in different files?
16:25:33
Bike
That's okay, as long as you don't actually use define-parenstatic before define-command is available.
16:26:12
jmercouris
you can see the ASD file here: https://github.com/atlas-engineer/next/blob/master/next.asd
16:29:01
jackdaniel
moreover your code will break, if body has declarations (due to what you do there, either get declarations correctly or wrap ,@body in locally
16:29:17
Bike
i'm looking at macro.lisp and the definition of define-parenstatic doesn't seem to match your paste.
16:30:48
pfdietz
beach: it would be interesting if the pretty printer could be made to print other languages as well. I think it already can, to large extent. I think Baker had a paper on this.
16:31:05
pfdietz
Another thing that would be nice would be printing to something other than raw ascii.
16:32:06
Bike
Are you sure that you're actually using the definition of define-parenscript with the define-command and not the one with the defun?
16:33:54
Bike
if i were you i'd reload everything, making sure the version of define-parenstatic with defun is never loaded
16:34:26
pfdietz
beach: so just as Eclector is interesting because it's extensible/customizable, so a printer would be. There are real use cases (came up in my previous job) where this would have been handy.
16:40:26
jackdaniel
and when you C-c C-c this single form, is the print triggered ? (inferior-buffer or repl)
16:46:07
pfdietz
beach: I think what a printer would need to produce is some intermediate representation (with indentation and line breaks computed), which could then be walked to produce the actual output (raw ascii, HTML, etc.)
16:46:21
jmercouris
jackdaniel: as expected, putting in the break before make instance results in the debugger coming up
16:47:49
jmercouris
if I manually C-c C-c the forms after my system is loaded, they exist in the hashtable
16:49:06
jackdaniel
and if you put break in this expansion (toplevel, before make-instance), do you get a break during load
16:58:47
jmercouris
however its okay, I can do without this functionality for now, I'll leave it out
17:03:03
jackdaniel
I've cloned your software (don't put binary data in git repository <sigh>), adjusted parenstatic macro and loaded it
17:08:24
jackdaniel
assets/ directory. repository has over 50 thanks to that, while source is less than 500KB
17:09:09
jackdaniel
just don't put pictures in git repository. either way clean your cache, clone repository anew, make change to the parenstatic macro and load it, problem solved
17:10:04
jmercouris
however at this point, I'm not sure how I feel about obliterating old data and forcing a fast forward or something
17:11:20
jackdaniel
do what you want, keep in mind though that pulling 50MB for 500KB of source code may be considered silly. git is not good at managing something what is not text (there are annex and lfs extensions for that afaik)
20:00:27
pjb
stylewarning: the problem being that *features* are usually used with #+/#-, ie. at read-time.
20:01:39
pjb
On the other hand, the purpose of that library may be to add it for the benefit of other libraries, such as client libraries, so it could add it whenever you want, at compilation-time, at load-time or at run-time, depending on the intended use.
20:01:45
stylewarning
Bike: I mean, would you just do a toplevel PUSH somewhere while the system is being compiled? Should it really be done at load time?
20:03:13
stylewarning
I want to place this variable to indicate a library has a particular feature (the library complies to a standard). So it seems like it should be done at load time, since somebody could compile it into a bunch of FASLs.
20:05:49
pjb
stylewarning: (eval-when (:load-toplevel :execute) (pushnew 'my-library:feature *features*))
20:06:17
pjb
It's better to provide features last, when you're sure the whole library has been loaded without errors.
20:12:29
jackdaniel
stylewarning: cffi has a separate file in its sources called "features.lisp" and it is the last file (just as pjb suggests)
23:23:42
verisimilitude
I see you've been working with CHIP-8, lately, no-defun-allowed; I find that interesting, as I've been working with CHIP-8 as a starting point for some of my works, although this isn't much related to Lisp. Feel free to PM me if you're interested.
0:39:06
no-defun-allowed
i'm looking for something harder to emulate that isn't risc-v or "lol write a ps4 emulator" though
0:39:55
verisimilitude
Oh, so you are interested in seeing what I've been working on that relates to this?
0:43:18
verisimilitude
You mentioned compiling unconditional CHIP-8 segments earlier; do you have a proper mechanism for when such code is modified or what?
0:50:17
no-defun-allowed
in future, i'll add a write barrier which checks for that and removes the compiled code
0:59:24
no-defun-allowed
i don't think i have tested any programs that use self modifying code though
1:03:27
verisimilitude
I strive to write small CHIP-8 games and I want to make use of self-modification, but the awkward memory access instructions get in the way of that, usually, although it's not for lack of looking for opportunities.
1:04:31
verisimilitude
I haven't looked through a large enough selection of such games to know how common it is, though.
1:19:46
verisimilitude
Well, I suppose if it's fine, I'll drone on about what I've been doing with CHIP-8 there.
1:54:49
hectorhonn
how do i use read-from-string to get the "form"? e.g. "(+ 1 2)" should give the list (+ 1 2), not 3. (does that make sense?)
1:56:03
verisimilitude
That's what READ-FROM-STRING does, yes, hectorhonn; you can also give it the usual :start and :end keyword arguments.
1:59:53
verisimilitude
It's very important to set *READ-EVAL* properly if you're going to be using the READ functions in a program.
2:00:22
verisimilitude
Yes; the #. is a reader macro that evaluates the form and acts as if it read in the result, instead.
2:02:04
verisimilitude
This also means you can temporarily bind it, such as with a LET, and it will use the bound value while executing the body of the LET.
2:02:57
hectorhonn
wait, if i setf it to nil in my package, then if another package calls read-from-string without let, which value will it see?
2:03:22
verisimilitude
If you set *READ-EVAL* to NIL, it will remain NIL unless something changes it.
2:05:51
verisimilitude
Assuming *READ-EVAL* here is the same symbol in the COMMON-LISP package, then that will be a global assignment, hectorhonn.
2:07:47
verisimilitude
If you're interested, I can point you towards a forum where you can ask more Lisp questions of any kind; it may be more convenient than IRC, since you can ask a question and then check for answers days or weeks later.
2:12:37
verisimilitude
Imageboards are a rather nice type of forum; you don't need to register an account or anything; in fact, there are no accounts whatsoever.
2:13:49
verisimilitude
In this imageboard, you simply get a random name with a post, unless you write a name explicitly. The idea is you can post in threads, not unlike an IRC channel, and the posts appear in those threads; you can attach images or other files to posts. You can also start your own threads, although I don't recommend it if you're new.
2:15:02
verisimilitude
If you'd like to learn more, I'll continue in a PM, so I don't glut this channel with unnecessary messages.
2:15:47
verisimilitude
Also, I may as well let you know that I'm the fellow behind that particular thread; it's a series of threads that have been going on four almost five years now.
2:28:00
verisimilitude
This issue doesn't matter unless you want the escape character itself to be a distinct event, however.
2:31:19
verisimilitude
From what I've seen, xterm and its ilk have multiple incompatible encodings for the function keys; I've only implemented one of these.
2:34:21
_death
verisimilitude: well, I started using it for some tui library ( see https://adeht.org/casts/tui.html ) but holidays were over and other stuff got my time..
2:37:43
verisimilitude
I have made some recent changes, so you will want to download the latest version and take a look at the updated documentation.
3:19:49
fouric
question: if i'm using symbols for "communication" between code in different packages
3:20:11
fouric
for instance, i have a library that opens a file descriptor and gets input from the keyboard, represented as a list of symbols
3:20:48
fouric
...should i (1) intern the symbols in the package of the called library (2) intern the packages in the keyword package (3) intern the symbols in the common-lisp-user package (4) not use symbols for that or something else?