freenode/#lisp - IRC Chatlog
Search
7:07:58
Harag1
beach: so when you have multiple .asd files do you put them in the projects main directory or with the module/extension code in their own directories?
7:08:13
aeth
ggole: The thing that makes it complicated is that (struct-aref foo 42) wouldn't always refer to the same thing if you wanted it to be a useful array concept. It could be invalid, it could be the same thing, or it could be a new thing. and (struct-aref foo 42) is probably isn't too far from 42*sizeof(your_foo_struct) in memory... so you'd need to be aware that the pointer could move all of the time
7:17:53
jackdaniel
aeth: I don't think there would be much utility in such agreement. most implementations already have reasonable limits above dictated by a standard, so we could put artificial flag: this is the minimum on the lowest one
7:18:11
jackdaniel
but nothing guarantees that Newly Implemented Lisp (NIL) doesn't have lower limits
7:18:56
jackdaniel
so from practical standpoint you already have such guarantees, from theoretical enforcement of it wouldn't be "de facto" standard but would rather require making a new standard
7:20:06
jackdaniel
but I take it as a compliment about approachability, thanks ;) that said there are other implementers here who do not shy away from being approached
7:27:59
pjb
aeth: struct or arrays implies copying the structures into the arrays. Therefore if you want to put the same structure in two places in the arrays, you end with 2 copies. You could use an array of indices into the arrays of the structure of arrays to place the same structure index at two or more places in the array of indices.
7:44:13
aeth
jackdaniel: well, yes, but it would be conforming in the same sense that an implementation without bordeaux-threads or
7:45:53
MichaelRaskin
I think CFFI uses #+implementation-name, which means that a really fresh implementation won't have CFFI
7:47:01
jackdaniel
aeth: as I said, from factual point of view all implementations have reasonable defaults, so they are indeed conforming to this imaginary requirement
7:47:25
jackdaniel
as MichaelRaskin said libraries are a different story, they are portability layers
7:48:12
jackdaniel
I think ABCL settles at a minimum wrt array dimensions, but I don't remember that well enough to be sure
7:54:22
aeth
MichaelRaskin: right, that was my point, that it would just be a thing that's expected but obviously not required
7:55:35
MichaelRaskin
I would say we also have a problem here, that you cannot meet that expectation immediately even if you implement FFI and threads in a way existing implementations do.
8:04:36
jackdaniel
de facto standard is something like pln extension (in constrast to portability layer)
9:04:44
refpga
Hi, do labels allow me to use local variables defined (outside but) within the same (parent) function?
9:05:49
refpga
so if I use labels to define functions within a let body, can I use the variables I defined using let, inside the labels functions?
15:01:55
gjvc
could someone point me at an example for reading very simple (not deeply nested) xml from a stream (file on disk) and dumping the resulting lisp form (total beginner here)
15:05:02
beach
gjvc: I would imagine the technique would be recursive descent, and similar to the code in a different language.
15:09:41
p_l
gjvc: I'd recommend using cxml, and maybe for actually doing something with the data, cxml-stp as it gives a nice recursive interface
15:12:22
moldybits`
why cxml, btw? it's easy to find a list of xml libraries, but it's hard to tell them apart.
15:13:09
p_l
moldybits`: it had pretty complete XML support, and it has cxml-stp as well as other (dom, etc) interfaces, plus a bunch of other code (I think xuriella xpath library works with it)
15:13:30
p_l
I'm aware of newer libraries, but for me cxml is kinda "tried and trusted" solution I take first when it comes to xml
15:14:38
moldybits`
i couldn't figure out how to specify the path to the dtd in cxml, so i ended up using plump which supposedly is more "lenient". (note: i'm a complete newbie wrt to xml)
15:16:23
p_l
(XML Schema isn't, and I find it superior in its limitations on what could be done with schema)
15:37:08
p_l
either I parsed XML differently in the past (lost source :( ) or I forgot how I specified dtd
15:39:11
p_l
had to download the dtd to home directory, but got this to pretty much output me a serialized form in S-expressions:
16:26:27
jgkamat
In case anyone was curious to my question yesterday, you need to have ps:lisp return a valid ps string, so (ps:lisp (push 'list my-list)) works for lists
17:31:39
p_l
my example included loading the DTD for apparently CXML didn't deal well with HTTP URIs in DTD specs
17:33:45
gjvc
yep got that and all working instaling into a project-local .quicklisp/ directory -- it's very neat
17:34:17
gjvc
i also have sbcl running via a bash wrapper to read the project-local sbcl initialisation file to make it take note of said project-local .quicklisp/ directory
17:39:05
gjvc
I have no interest in bootstrapping from them every run, given that the data is so simple
17:40:00
gjvc
but this is a more educational approach that just doing a big search and replace. (although i could write something in python to read the xml and emit lisp hmmm ...:-))
17:40:25
p_l
gjvc: then I think STP might offer a simple interface to rewrite them into whatever you want (it provides something akin to recursive descent where you plug your functions using STP methods to do things)
17:53:15
rumbler31
ok, I'm too dumb for this apparently. I want to generate and write a very long string to a file, constructed letter by letter. (dotimes (i large) (write #\E)) writes #\E, I am looking for the character itself to be read without the #\. Various attempts have failed. I suppose I could just use (format... but I'd like to learn what is going on here
17:54:31
rumbler31
assumption that was false is that I need to print pretty. that doesn't change the output unless I invoked it wrong
17:55:19
rumbler31
I assume that #\ is necessary for the reader to treat the form as a character and not a sybmol
17:57:00
pmai
FWIW write is very flexible, you can specify what you want using the keyword args or through the normal printer variables
17:57:52
rumbler31
write-char... of course. Also fwiw I was having a hard time understanding how the various flags to write relate to make thi shappen
18:38:02
p_l
Generally, for top-level variables: defvar, defparameter (the latter will always overwrite current value when evaluated), for constants use defconstant
18:38:34
p_l
mind you, defvar and defparameter will create dynamic variables, not lexical, but lexical top-level is a bit iffy
18:40:53
p_l
vms14: why do you need them in one form? It doesn't change things in the end, except for unexpected breakage from SETQ use
18:43:35
pjb
ggole_: (write foo :array t :base 10 :case :upcase :circle nil :escape nil :gensym t :length nil :level nil :lines nil :miser-width nil :pretty nil :radix nil :readably nil)
18:44:09
pjb
ggole_: of course, you can use ~A or ~S or princ or prin1 which pass the right key arguments to write.
18:45:37
p_l
vms14: because the general consensus was that assignment should not create new variables where there none
18:48:00
p_l
vms14: I tend to use DEFPARAMETER for things that I pre-set to some value, and include documentation on them (which it allows) which makes it simpler to understand the code the next day
18:48:47
p_l
i.e. it's much easier (IMO) to reason about a bunch of DEFVAR/DEFPARAMETER/DEFCONSTANT, especially when they include documentation, than any single SETQ anywhere in code
18:56:01
p_l
pjb: but the projects that insist on C either insist on it for the rare good reason (work on kernel code base in C) or can be safely ignored
18:56:27
p_l
projects that insist on language in my experience mostly involved corporate wanting java or similar :/
18:56:49
p_l
if you are the side signing the contract for the application, though, you can usually get any language going
18:57:42
p_l
vms14: and for good reasons implementations don't implement their own random object file linkers :)
18:58:03
p_l
(nothing stops you from doing one, though you would probably have to use less nice sides of FFI)
19:05:23
pjb
filename is already a pathname designator, you you don't need to call pathname on it, open will do it.