freenode/#lisp - IRC Chatlog
Search
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.
19:07:37
pjb
(with-open-file (stream filename :element-type '(unsigned-byte 8)) (cxml:parse stream handler))
19:13:27
_death
if filename is a string, then you likely want to use uiop:parse-native-namestring because otherwise each lisp implementation defines its own namestring format...
19:13:27
minion
_death, memo from flip214: I've got a couple of (old!) patches up at github.com/phmarek/dbus.git ... Would you please take a
19:18:47
pjb
vms14: (macroexpand-1 '(with-open-file (stream filename :element-type '(unsigned-byte 8)) (cxml:parse stream handler))) #| --> (let (#1=#:g37601 #2=#:g37602) (unwind-protect (multiple-value-prog1 (let ((stream (setq #1# (open filename :element-type '(unsigned-byte 8))))) (cxml:parse stream handler)) (setq #2# t)) (when #1# (close #1# :abort (null #2#))))) ; t |#
19:19:25
pjb
vms14: at home, try: (pprint (macroexpand-1 '(with-open-file (stream filename :element-type '(unsigned-byte 8)) (cxml:parse stream handler))))
19:27:36
vms14
I guess people usually don't mind in have features like what lisp offer and they look for something more mainstream
19:28:02
vms14
but when they have like 10 years of programming experience they'll be making complex systems
19:29:45
vms14
the problem is the programmer usually won't likely switch to lisp when he has 10+ years coding in somelanguage
19:33:31
LdBeth
It’s funny cause no other language use different implementations for development and deployment