freenode/#lisp - IRC Chatlog
Search
13:19:09
jsjolen
Hi. I want to have a modern (aka case-preserving) readtable. That's easy with named-readtable. Now I want to downcase the CL package and its symbols so that I can use it 'naturally'. My attempt: D-E-S over CL, SETF FDEFINITION and SYMBOL-VALUE. My issue: I can't SETF FDEFINITION of special operators. Is there anyting else I can do? Is there a solution for this?
13:21:55
jsjolen
dlowe: Yeah, but I want variable case. I want to do stuff like defclass MyClass (this is for personal use)
13:24:47
jsjolen
http://www.lispworks.com/documentation/HyperSpec/Body/23_aba.htm there it is, aah crap :)
13:27:36
Bike
if you did want to stick with the first idea for some reason, just define macros, like (defmacro my-cl:|progn| (&rest forms) `(cl:|PROGN| ,@forms))
15:59:07
jcowan
As a Unix non-hater, I can say that the BSD API is definitely not aligned with the spirit of Unix.
16:26:37
verisimilitude
It's not the only bad API; it's what one's stuck using under GNU/Linux and the BSDs, in any case.
16:32:35
verisimilitude
Making a network request should in no way be more laborious than making a filesystem request, at the least, I think.
16:35:36
PuercoPop
verisimilitude: but besides opening the socket sb-bsd-socket gives you a socket to write and read from, is that not what you are looking for?
16:37:16
verisimilitude
Just opening the socket is bad enough. SB-BSD-SOCKETS:SOCKET-MAKE-STREAM gets a proper interface, however.
16:39:40
verisimilitude
Yes, trafaret1; so, lambda gives one the ability to play with functions as one would with other data.
16:46:36
verisimilitude
I've been skulking around for some details concerning Genera's network facilities, but haven't found much in the way of details yet; if any of you know where to find this, I'd appreciate it.
17:12:34
pjb
PuercoPop: int server=open("/dev/tcp/www.google.com/80","r+"); int ret=write(server,"GET /\r\n",7); char buffer[8192]; ret=read(fd,buffer,sizeof(buffer)); close(fd);
17:14:54
verisimilitude
The Google homepage is 220 kilobytes, pjb, so your C example doesn't work as well as you think.
17:15:42
verisimilitude
I know, but a real solution would require more than those few lines is my point.
17:16:15
pjb
Of course. This is the unix way: simple kernel, complex userland. Requires good and disciplined programmers.
17:17:45
emaczen
Why is (decode-universal-time 0) giving me december 31st 1899 at the 16th hour of the day?
17:17:46
minion
emaczen, memo from phoe: if your hooks depend on each other (e.g. due to calling order), then they are actually a badly factored single hook - and they should become a single hook
17:17:58
dlowe
you can open a socket in plan9 like cd /net/tcp/`/net/tcp/clone/ctl`;echo connect example.com 80 >ctl;echo "GET / HTTP/1.0" >data;cat data
17:18:47
pjb
If time-zone is not supplied, it defaults to the current time zone adjusted for daylight saving time. If time-zone is supplied, daylight saving time information is ignored.
17:20:59
moldybits
i have a little snake game. there's a class that keeps all the state, and now i wish to add state-saving. my problem is that one of the slots store a lambda. i could specify that it's not allowed to be a closure, i guess ...
17:21:48
Xach
emaczen: >> time zone n. a rational multiple of 1/3600 between -24 (inclusive) and 24 (inclusive) that represents a time zone as a number of hours offset from Greenwich Mean Time. Time zone values increase with motion to the west, so Massachusetts, U.S.A. is in time zone 5...
17:31:54
moldybits
if i want to save a lambda to a file, i'd need to store the sexp somewhere myself, right?
17:33:53
moldybits
if i have a (lambda () 42) list, what's a good way of turning it into a function? eval?
17:38:39
Bike
which will probably run more efficiently, but the compilation process will take longer
17:38:49
Bike
...assuming the implementation actually has a separate compiler and evaluator, which it may not
17:40:10
Bike
may i ask what it is you're actually doing, that you want to save functions to a file?
17:41:21
dlowe
I mean, you could write code to a file, then call COMPILE-FILE which might make a fasl
17:41:34
moldybits
i want to save the current state of the snake game. how to calculate the new cooldown for the snake (based on its length) is a lambda that i want to be user-modifiable.
17:44:56
verisimilitude
If you call a function in SNAKE-COOLDOWN, set by a file LOAD or with a default value, otherwise, you can of course still change this variable at any point.
17:47:08
moldybits
hm. there's a further complication: replays. i need to store every change to the state somewhere.
17:48:27
moldybits
(set-cooldown-calculator '(lambda (snake-length) ...)), and set-cooldown-calculator will stuff this into the replay.
17:50:51
moldybits
i'm using this snake game to figure out how to structure more advanced games in the future. i've run into these issues before.
17:58:41
Xach
moldybits: it would be more tractable to maintain state in an object passed into callbacks.
18:02:47
moldybits
i'm not following exactly. my thought was to not allow any free variables in the callbacks.
18:05:08
moldybits
eventually i would want the callbacks to be evaluated in a separate environment, with a custom eval
18:18:40
moldybits
Bike: i'm not sure? i want code writing to be a part of some games. suppose this snake game has a level where you're supposed to figure out the appropriate cooldown function to get past some obstacle in a clever way, or something.
18:36:09
jdz
moldybits: Probably something similar to what you're doing: https://technomancy.itch.io/bussard
19:19:31
sjl_
A while back I proof-of-concepted using https://github.com/jessymilare/storable-functions to serialize lambdas to https://github.com/conspack/cl-conspack
19:19:45
sjl_
it wasn't super pretty, but it worked https://github.com/sjl/sand/blob/fc0cb77fd8eefec8d29d69a1eca36f599101b890/src/serializing-functions.lisp
20:14:20
White_Flame
Xach: is there a simple way to download an entire ql dist for offline site usage?
20:15:13
Xach
White_Flame: in packager ql-dist-user, evaluate (map nil 'ensure-installed (provided-systems (dist "quicklisp")))
21:29:39
pjb
sjl_: I fail to see the point in conspack when the problem is to serialize functions. In anycase, we cannot portably or even conformingly serialize functions (much less closures), only lambda expressions, which are S-expressions, and for which there is a perfectly good serialization format: S-expressions!
21:30:08
pjb
sjl_: (print1 lambda-list stream) is all that is needed to write, and (read stream) all that is needed to read a lambda expression.
21:57:42
verisimilitude
It helps if FUNCTION-LAMBDA-EXPRESSION gives a useful result instead of the useless one that's common. If you have the LAMBDA and its name, you can serialize the function definition.
22:13:26
pjb
moldybits: Yes, this is why I wrote lambda expression which refers to the whole lambda expression.
22:14:17
pjb
verisimilitude: Since you cannot count on function-lambda-expression, you have to implement your own bookkeeping. see; Image Based Development http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html
22:15:00
pjb
An alternative, is when you have your own model for functions and other expressions, then you can implement a decompile method. This is what is done in Patchwork.