freenode/lisp - IRC Chatlog
Search
12:31:39
beach
easye: There is a tradition, but things are different this year because of the co-location with <programming>
12:32:06
beach
easye: So the banquet is on Wednesday, and it's for the entire <programming> conference.
12:33:10
beach
There is nothing organized for just ELS, and the banquet is not included in the price for just the symposium and the workshops.
12:36:00
easye
+1 on an April 3d dinner. But I have no cycles to help organize (working on abcl-1.5.0)
13:35:30
beach
So here is an idea for a cute feature of Common Lisp mode of Second Climacs: Hold the mouse over a lexical variable, and the possible definitions (such as LET bindings or assignments that may determine its value at that point) will be highlighted. Other uses of the same variable (including assignments that can not determine its value at that point) will be highlighted differently.
13:39:55
beach
It involves computing so-called DU and UD chains, but that can be done since I have a complete parse of the code.
15:22:05
ogamita
Now, depending on your hardware, it may be more efficent to fork threads and write different parts of the blob from different threads.
15:23:38
dxtr
We are migrating our ecommerce system and I have to import product images for 70k products
15:26:56
ogamita
Nowadays, we have large RAM so you can avoid hitting the SSD until you have the final file in general.
15:30:51
dxtr
#<SB-SYS:FD-STREAM for "file /home/dxtr/quicklisp/local-projects/imageimport/catalog/product/l/u/lulz" {1001F8B533}> is not a character output stream.
15:38:46
didi
So http://lisptips.com/post/53970107740/adding-an-item-to-a-sorted-list taught me how to add an item to a sorted list. But what if I want to add an item only if it is not a duplicate of an item already in the list?
15:54:39
didi
White__Flame: True. It is a possibility. But I am writing a simple implementation for now.
15:57:31
ogamita
Also, it depends on your processor and DRAM system. I hear that some DRAM system/processor cache make it so RAM accesses are done by lines of 64 bytes at once (you read one byte, the RAM sends 64 bytes; you write one byte not in cache, the RAM sends 64 bytes, the cache is updated, and the flush sends 64 bytes to the RAM).
15:59:03
ogamita
In such a system, an array of 16 or 8 elements could be updated by the processor in cache without RAM access as fast as a single RAM access, so inserting into such a small array would not be slower than inserting in a list. Probably faster in fact.
16:00:25
_death
if you expect a lot of duplicates, you can maintain both a hash-table and a sorted list
16:02:04
_death
as long as you hide the implementation detail behind an abstract data type, it's ok to start simple
17:02:53
scymtym
they are both (asdf) systems, have been written by the same authors and are both unmaintained. that's why i mention them together like that
18:15:52
dwrngr
ebrasca: what happens if outside its own package, you try packagename::*l-system* instead of just *l-system* ?
18:25:14
Bike
would you please try to explain what you mean rather than repeating code with no context
18:27:00
Bike
Sure, whatever. I'm saying that if you define *l-system* in some other package the symbols are not read as being in the turtle-graphics package.
18:27:15
phoe
if you're in your package, then list '(a b c d e f) read from the Lisp reader will be all symbols from your package.
18:27:17
Bike
Because turtle-graphics::f and some-other-package::f are distinct symbols, most likely
18:27:28
phoe
if you're in another package, then list '(a b c d e f) read from the Lisp reader will be all symbols from another package.
18:27:53
daemoz
How do I quote the result of a variable? ex. (foo 'variable) where variable equals (1 2 3) and I want the call to read (foo '(1 2 3))
18:29:23
dwrngr
ebrasca you never answered my question, it should help you understand what Bike is saying if you can
18:30:04
daemoz
phoe: Yes I am, and the result of the macro depends on a config file that for convenience has element simply written as "(1 2 3)" for instance.
18:36:19
pebblexe
I am trying to parse some json, but since it's not being returned as a string none of the decoders work
18:39:28
phoe
like, mapcar returns a list of values returned from the function, mapc returns the first original list.
18:42:28
daemoz
Bike: I'm dancing around this trying to quote the result of an evaluation and this is where I wound up T_T
18:44:02
Bike
you want midi-info to be a list of four elements, the first of which is the symbol LIST?
18:46:06
daemoz
phoe: Okay, that makes sense to me now. I for some reason though that macros would unquote their result first before passing to other macros. That was silly.
18:47:34
daemoz
That's what so amazing about Lisp to me and I think why I feel the desire to make everything a macro
18:48:31
phoe
code making code is awesome, but actually not all that practical for things like *this*.
18:49:07
Bike
well, it's what's being done here. daemoz wants a form that makes a list, for whatever reason. it's just that you can do that without bothering with nested backquotes or whatever complex silliness
18:49:11
daemoz
Okay. I'll remove pass-list, use the (cons 'list) trick and remove all the then unnecessary quotes.
18:50:28
daemoz
phoe: I feel it, dude. Definitely pass-list was totally unecessary and I see that. I was just not able to figure out how to make a list out of conses like that.
18:50:37
phoe
but when I was taking my first steps in Lisp, it was people around here who taught me that most of the time, functions are surprisingly good enough - especially that they're fully first-class in Lisp.
18:51:24
phoe
Well, backquote syntax is completely redundant as well. Macros simply return code in form of lists, and you can construct all lists with CONS, LIST and possibly LIST*.
18:51:57
phoe
It's just that in this case LIST is a step up from CONS and `, is a step up from LIST.
18:52:38
shrdlu68
I'm tryig to imagine what code with defmacro everywhere rather than defun would look like, and what it would do.
19:05:02
andyloveslisp
I've successfully parsed a json request into an alist of string. Is there a best practice way of manipulating this to an alist of symbols? I was just thinking of using (intern ..)
19:07:16
shrdlu68
After further deliberation, the committee placed the CLHS in the Index Librorum Prohibitorum.
19:08:21
phoe
Just don't be worried if you suddenly see symbols like |value| or |randomURIDesignator| in your package.
19:08:47
phoe
Also - be wary that once you intern these strings, they will stay around until you delete the package, which might mean forever.
19:09:21
phoe
Which might mean that sending arbitrary JSON to your server will be able to fill up its memory by interning arbitrary strings inside your package, making them persistent and uncollectable as garbage.
19:19:08
phoe
jurov: from what I've researched and what I've implemented in the library above, there are three bad things that can happen.
19:22:14
phoe
you'd more or less need to implement a Lisp reader to recognize matching parens, at which point you've reinvented the wheel.
19:23:17
jurov
I was thinking "maybe there's some combination of standard reader options that can read safely".. so there isn't?
19:29:14
andyloveslisp
I can pull apart the string before I read it? There should be no parenthesis in my inputs, so I could block the process on discovery of any.
19:30:34
phoe
Second: ...actually, if you're not reading S-expressions, then hacking around the Lisp reader won't work. See point one.
19:31:29
White__Flame
it's theoretically nice to pull in numbers and strings, but if there are slight format discrepancies they'll bite you
19:31:40
shrdlu68
If the string should not contain parens, then simply blocking a string with parens and otherwise reading should be fine, no?
19:32:12
White__Flame
if a string contains "foo", then READing it will create the symbol FOO, having applied the read case
19:32:38
andyloveslisp
well I grab a json string from hunchentoot, use string functions to inspect it, then use read functions to convert to lisp symbols/numbers.
19:33:51
White__Flame
but you'll probably need to upcase it manually as well, if you want it to look like normal symbols
19:34:02
andyloveslisp
Well there are numbers, and intern creates a |1| symbol rather than the number 1
19:34:39
White__Flame
andyloveslisp: wait, if you read {"a":1}, you'll get ("a" . "1") in your lisp-side a-list?
19:35:42
White_Flame
you can do (eq str1 str2) and it'll be just as fast, probably not correct though ;)
19:35:43
andyloveslisp
no I parse using yason from {"a" : "1"} to ("a" . "1") then I'm on my own from here.
19:37:11
andyloveslisp
yes it's correct but I eventually want (a . 1) to feed to the rest of my program
19:38:30
White_Flame
unless you know for certain that that particular field intends to hold a number in string format
20:20:58
theseb
I'm fascinated by these minimal lisps with few primitives. Can these little langs can be USEFUL....All I can think of is maybe as teaching tools!?!
20:21:51
White_Flame
but when they're embedded into a program, they can be quite useful for scripting functionality
20:21:57
theseb
they're just sooo cool and mathematical and elegant i want to do something with the little lisp i made
20:23:53
pjb
I may be wrong, but I see no reason why CL stream would be implemented using C FILE. They're implemented using directly POSIX file descriptors.
20:24:37
haom
pjb: i want to pass a file pointer to a c function through CFFI, do you have an idea how i could do that?
20:25:36
pjb
haom: beware however that then you will have two buffers, one in the lisp side, and one in the C side. Better flush your buffers before changing sides.
20:30:43
theseb
White_Flame: embedded languages!!!! yes! for when Python and Java and Common Lisp are a little too heavy to be embedded..yes makes sense!
20:32:18
theseb
White_Flame: i've been a dev for 20+ years....i've never had to "embed" a lang in an app...when does that come up?
20:33:41
White_Flame
but seriously, game scripts, utility macros, configuration languages, all of that stuff is much more useful to consider dynamically at runtime
20:34:18
White_Flame
useful for the end-user that is, and can reduce a lot of developer burden too, if the main application is C/C++/Java/etc
20:37:42
didi
shrdlu68: For instance, say I want to mark a list with a sentinel, so I want when to stop processing. I push (defparameter *sentinel* '(nil)) to it. Even if '(nil) ends up in the list, it won't be EQ to *sentinel*.
20:52:17
Bike
well the thing is that eql and eq have same results except on characters and numbers, and neither of those are one where you can deliberately allocate a new instance.
21:07:48
pjb
EQ is an implementation introspection mechanism. We only have to know about it because some old function use EQ instead of EQL, and therefore cannot be used with characters or numbers. (eg. GET). (cf. clhs eq)
21:22:22
nyef
New possible plan for the MacIvory: Get a keyboard from wasdkeyboards, and a 3-button PS/2 mouse. Use a PS/2 adaptor on the keyboard. Run the PS/2 connectors to an AtMega328, and from the AtMega328 to an ADB port on the IIfx. Program the microcontroller to translate keycodes and mouse events to what is expected by the MacIvory and the "mousekey" driver.
21:27:54
nyef
Mmm. It's that, or trying to get the mousekey 2.0 driver working with the MacIvory, or trying to find an older version of the 3-button mouse that I have.
0:15:52
didi
What do you think of my `find-sorted' function: https://paste.debian.net/hidden/d4868f9e It finds an item inside a sorted sequence. The purpose is to stop short if the item can't be beyond a certain point.
0:23:00
nyef
But under the circumstances, if you're even trying this, the list is probably the wrong data structure in the first place.