freenode/#lisp - IRC Chatlog
Search
19:44:30
comborico1611
The main source of my current confusion is here. https://pastebin.com/hEJqdvXA
19:45:34
comborico1611
The author writes as if the accessor functions are implicitly defined from the subsequent creation of the structure.
19:49:21
buffergn0me
comborico1611: Indeed the accessors are defined by defstruct. How are you trying to run the code?
19:49:35
_death
you can see for yourself with (macroexpand-1 '(defstruct op action preconds add-list del-list))
19:59:04
comborico1611
Very annoying -- I don't know why I must retype type the quote marks. But for some reason, I must retype them. I was going to run the code directly from book. (I changed names of things for my understanding.)
19:59:58
comborico1611
buffergn0me: Here is the full program. But quotes are not registering correct on my Emacs. https://pastebin.com/qE19McPf
20:02:38
buffergn0me
comborico1611: Some program is "helpfully" replacing regular quotes with Unicode smart quotes
20:18:34
comborico1611
I got it to work! Now to figure out where things went wrong. Thanks everyone for help.
20:57:18
comborico1611
I believe the problem was I had the function definition too far down in code. I didn't realize that was an issue.
21:13:26
Josh_2
Parenscript is used to generate JS functions which can be written to files called .js files right?
21:17:06
buffergn0me
Josh_2: You can do that. Also generate the JS dynamically and serve it from a URI handler, or put it into inline <script> tags
21:17:55
Josh_2
buffergn0me: I have .html files that are handwritten instead of using a markup generator
21:19:13
Josh_2
I'll write my js with parenscript and output it to files then just manually include the names in my html files
22:00:53
pjb
buffergn0me: this is wrong, compile-file treats the file as a compilation unit. it uses with-compilation-unit! See
22:02:05
pjb
djeis[m]: it doesn't depend on the CL implementation. Any conforming CL implementation WILL HAVE to use with-compilation-unit (or the same effect) in compile-file, or it won't be a conforming implementation of ANSI CL!
22:08:25
buffergn0me
That's true, but what can you rely on WITH-COMPILATION-UNIT for? The only thing seems to be that forms are evaluated left to right
22:13:47
pjb
buffergn0me: it won't signals undefined function warnings when functions are defined after their use.
22:20:46
buffergn0me
Yeah, it definitely keeps things simple. There are a lot of things to be said about module systems that treat files/modules as units, simplicity and efficiency are not part of those things
22:31:50
pjb
I'm even more in the school: let emacs store the toplevel forms in the positions it determines itself by a topological sort.
22:48:09
pjb
That would free people of the burden of spreading their toplevel forms to several files, etc. This would be handled automatically.
22:49:40
verisimilitude
I find it stupid when a language forces files to be orthogonal with compilation units. Avoiding this is much more flexible, I think, and avoids the mess with largely superfluous files littered about.
22:53:24
buffergn0me
Well, you could have a compilation unit be a set of files in an ASDF definition
22:53:41
pjb
well, files are stupid to store code. They're good on a unix system, but interlisp allowed image-based development, and other ways to store the sources could be useful, with nice tools to query and navigate the source. For example, since we have multiple dispatch methods, we may want to see all the method dispatching on class A, and then all method dispatching on class B, then a (defmethod moo ((a a) (b b)) …) would appear in
22:53:43
_death
I have a catjava utility to concatenate all java files.. then I use a hide-comments function.. then I can read the code :)
22:54:50
aeth
I disagree. With files, you have a known working state you can inspect completely. With images, well, let's just say I use M-x s-r-i-lisp a lot.
22:55:45
aeth
Sure, you could have a presentation layer on top of files that selects e.g. all of the method source code.
22:56:39
Xach
akater: quicklisp-slime-helper is a way to get slime without much other setup. it is guaranteed to be synced with the quicklisp swank version. if you have another way to get and init slime, there is no advantage. it's pretty handy on a "cold" system in my experience. it predates emacs packages being very convenient.
22:57:11
pjb
Having a static "script" to reproduce a similar image is god, but it doesn't imply using files. The source can be stored in a database or otherwise.
22:57:23
aeth
pjb: But I don't want to think database instead of file. The files are essentially scripts that create a reproducable working state
22:57:26
verisimilitude
You could have image-based development with CL if implementations had FUNCTION-LAMBDA-EXPRESSION work well every time.
22:58:15
pjb
aeth: they're a simple solution granted. But again, newbies and a lot of people seem to have problem organizing themselves, so if it can be automatized, soon you can see that you can use other storage systems.
22:59:03
verisimilitude
Modern file systems don't even have versioning, as they lost it, so it's bad all-around.
22:59:29
aeth
pjb: The problem is tools. It doesn't take much to go from M-. (which will always work and take you to the first line, except for some rare C-c C-c cases) and paredit etc. to being able to create new "files" of every defmethod foo
23:04:15
aeth
verisimilitude: file systems don't have versioning but we have the 80% solution of git, which we can use for all of the important text files
23:04:43
buffergn0me
gilberth: That is what WGREP-CHANGE-TO-WGREP-MODE does in GNU Emacs grep buffers. Essentially displays and edits subsets of multiple files in one buffer
23:04:47
verisimilitude
We have git, an ugly, manual, explicit, and worse implementation of part of a real file versioning system, yes.
23:05:17
aeth
verisimilitude: Every file being versioned would have to solve more problems, like binary files and unimportant files and things like password files
23:06:11
_death
verisimilitude: versioned files is wrong.. and git is progress, as it tracks not files but changes
23:06:22
buffergn0me
verisimilitude: The problem with per-file versioning is that it is only as powerful as CVS. You want to track changes across multiple files at once
23:07:26
verisimilitude
You could even have the file system have a means for relating files in this way, when it becomes understood that a file isn't just a bag of bytes and can have real attributes.
23:08:28
verisimilitude
File versioning is when you save changes to a file, you still have access to the file's older version and yet older versions.
23:10:20
aeth
I have emacs store them all in .~ so e.g. ~/foo.txt will have ~/.~/foo.txt~1~ etc. and it will never delete old ones because I set it like that. Emacs only does this if it doesn't detect it's in version control (it even does it for files in version controled directories that aren't themselves version controlled!)
23:10:27
pjb
name.type.~version~ Unfortunately most implementation cannot translate logical pathnames versions. For example, ("H:**;*.*.*" "/**/*.*.~*~") translates #P"H:tmp;foo.bar.42" to "/tmp/foo.~bar" in ccl.
23:11:34
aeth
I still prefer git to Emacs's backup system because per-file has major problems once you move past one file. Does foo.txt~123~ line up with bar.lisp~57~ or do they not even line up at all because I never had a working state among the backups? (git, since you explicitly check in, ideally has every combination of files working)
23:13:45
buffergn0me
aeth: I put everything in a single folder in my home directory (full pathname gets appended to filename that way), even files in VC. It's a good backup system, not a very good version tracking system
23:14:18
_death
no.. it's only requirement is for a repository to be in a directory, and the git database is then a .git directory in that directory
23:15:47
verisimilitude
Well, that's good then; my website is completely flat and I wouldn't want to change that.
23:16:46
_death
that's no problem.. just do: git init ; git commit -am 'initial commit' and you have a repository
23:18:33
verisimilitude
I've still yet to learn how to use git, along with deciding whether I will, but if I'm not required to introduce directories, then that doesn't rule it out.
23:19:11
_death
the only thing this does is create a .git directory with the database containing the current state
23:20:59
_death
you can inspect it using a tool like gitk, change stuff and use "git gui" for easily committing (or see http://emacsrocks.com/ episode 17 ;), and finally delete the .git directory if you're not satisfied
23:24:12
verisimilitude
Alright; I'm very wary about file I didn't create myself that are public, as is.
23:28:21
_death
also, re-watching that episode, it's not really an introduction to magit.. so some other one is to be found
23:45:38
_death
(on first use, git may ask you to set a name and an email.. they should also add blood type, may come handy on one stressful day ;)
0:41:02
slyrus_
Ugh... My xml-foo is rusty. Are there any libraries for dealing with XML schemas (besides cxml-rng -- I want old school XML schemas not RNG schemas -- I think).
1:22:51
Josh_2
Something about if I'm using eval I'm doing something wrong Q_Q https://plaster.tymoon.eu/view/1230#1230 can someone please help me fix this.. it works but it doesn't seem right to do it this way
1:28:16
Bike
it looks like replacing (eval `(ps-to-stream ,stream ,x)) with (ps-to-stream stream x) should be fine
3:28:51
Josh_2
I can't have inline cl with hunchentoot can I, I have to generate my code dynamically using a library like cl-who and then output that with whatever modifications I want based on variables like cookies or post values??
3:29:32
no-defun-allowed
you can have inline CL, using FORMAT or the like, hunchentoot just wants a string
3:29:41
no-defun-allowed
but use CL-WHO cause it's really good and lets you use CL macros for templating
3:30:18
gilberth
Heh, same problem! APIs that tried to be clever by offering macros instead of functions :-)
3:31:44
no-defun-allowed
(define-easy-handler ... (format nil contents-of-file . args) or even just (define-easy-handler ... contents-of-file)
3:32:08
no-defun-allowed
gilberth: CL-WHO tries (and succeeds) to be clever because it generates calls to WRITE-STRING to emit the HTML
3:32:49
no-defun-allowed
and it has a very convenient DSL which lets you jump between s-exp HTML and CL so it has to do that, unless you want quasiquotation and effectively an "interpreter" of the DSL
3:34:54
gilberth
I like a more functional approach better: build some internal representation of the HTML and then dump that.
4:03:09
pillton
Josh_2: It is often better to write functions to generate the code you want first. Once you are happy with the result, define the macro function to invoke those functions.
4:10:39
beach
I am not so much here either actually. I am traveling with a dinky laptop. Very small and very slow. So it's not comfortable at all.
4:11:31
gilberth
Heh, but at least it seems to have a keyboard. So it is better than a smart phone for typing :-)
7:00:14
fiddlerwoaroof
e.g. if I want to type numbers like 1_000_000, can I do it by saying "ignore _" without re-writing the number reader?
7:11:48
fiddlerwoaroof
Hmm, I guess you could wrap the input stream to contextually suppress underscores
7:12:49
slyrus_
gilberth: do you know if anyone has extended cxml to work with XML Schemas (besides the cxml-rng stuff)?
7:14:14
fiddlerwoaroof
e.g. (let ((*standard-input* (underscore-ignoring-stream *standard-input*))) (loop (print (eval (read *standard-input*)))))
7:14:49
fiddlerwoaroof
where the wrapping stream would peek-char to see if there was an underscore waiting and, if so, not pass it along
7:16:03
gilberth
slyrus_: Sorry, I don't. Althrough I am the original author of cxml, I left it last century. Sorry about that.
7:17:37
gilberth
fiddlerwoaroof: You still want to be able --- in theory --- to read symbols like "foo_bar"?
7:18:24
fiddlerwoaroof
Even then, you could have a little state machine that detects <whitespace><number> and then activates underscore-ignoring mode
7:20:43
fiddlerwoaroof
While, the reason I'm asking is that I'm interested in thinking about the various sorts of incremental changes that can be made to the lisp reader
7:21:19
fiddlerwoaroof
And I happened to see a post about how Haskell has a language extension that lets it accept the Swift/Ruby style numbers with _ as a separator
7:21:21
lieven
good luck. I've always found the chapter about the reader with its constituent and non constituent characters etc one of the scariest in the spec
7:22:10
fiddlerwoaroof
lieven: interesting, I haven't written any really complex reader macros, but I've never found them particularly difficult to implement
7:23:03
gilberth
On the lisp machine the package prefix was a prefix. You could say FOO:(BAR BAZ QUUX)
7:23:28
fiddlerwoaroof
Well, for the first one, couldn't you copy-readtable and get a readtable that that worked for?
7:24:16
lieven
the lisp machine also had an extension for file syntax IIRC. where you could put Syntax: into the first line and it would load the syntax/readtable stuff for you
7:24:23
gilberth
OK. What you are up to? Do you want to serious experiment with new syntax, or do you just want 1_000_000 to work?
7:26:17
fiddlerwoaroof
what sorts of syntax changes it makes easy, which ones it doesn't help with and which it makes hard