freenode/#lisp - IRC Chatlog
Search
18:11:51
pjb
Using flatten and thus implementing a modular solution would be good to ensure you get a correct function, but it would use more temporary space (and more O(1) time), so it may be rejected for production. Of course, if you need to avoid the use of space, you need to be working on trees that fill half or more of the memory!
18:12:44
johnnymaster
(defun reduce-tree (fn tree &optional init-val) (cond ((null tree) init-val) ((atom tree) (funcall fn init-val tree)) (t (reduce #'(lambda (x) (reduce-tree......))))))
18:13:55
pjb
johnnymaster: well, you have to answer the question of what kind of tree you're dealing with here. cf. http://groups.google.com/group/comp.lang.lisp/msg/0c66e597e08be90d
18:17:14
pjb
johnnymaster: what you would put in that lambda, is what you should put for the whole function! ;-) cf: (t (......) using reduce and a lambda call
18:17:20
pjb
*** Josh_2 (~user@cpc88041-dund14-2-0-cust452.16-4.cable.virginm.net) has quit: Ping timeout: 260 seconds
18:17:22
pjb
<pjb> Using flatten and thus implementing a modular solution would be good to ensure you get a correct function, but it would use more temporary space (and more O(1) time), so it may be rejected for production. Of course, if you need to avoid the use of space, you need to be working on trees that fill half or more of the memory!
18:17:31
pjb
<johnnymaster> (defun reduce-tree (fn tree &optional init-val) (cond ((null tree) init-val) ((atom tree) (funcall fn init-val tree)) (t (reduce #'(lambda (x) (reduce-tree......))))))
18:17:41
pjb
<pjb> johnnymaster: well, you have to answer the question of what kind of tree you're dealing with here. cf. http://groups.google.com/group/comp.lang.lisp/msg/0c66e597e08be90d
18:17:47
pjb
#lisp johnnymaster: what you would put in that lambda, is what you should put for the whole function! ;-) cf. http://sprunge.us/QUQL
18:17:57
pjb
johnnymaster: what you would put in that lambda, is what you should put for the whole function! ;-) cf. http://sprunge.us/QUQL
18:21:34
pjb
There are several questions: where is the init-val used? once for the whole tree? Once for each subtree?
18:22:00
pjb
And there's the question of what defines a tree. eg. What should happen for ((1 . 2) (3 . 4)) ?
18:23:13
pjb
johnnymaster: So write down a specification, then you can write test cases, and then you can implement it.
18:34:58
shka
johnnymaster: (defun reduce-tree (fn tree) (reduce fn tree :key (lambda (x) (if (atom x) x (reduce fn x)))))
18:36:25
shka
johnnymaster: (defun reduce-tree (fn tree) (reduce fn tree :key (lambda (x) (if (atom x) x (reduce-tree fn x)))))
18:37:19
Bike
How annoying would it be if loading fasls didn't install inline definitions for the compiler?
18:40:53
pjb
johnnymaster: in general, it's better to use &key rather than &optional, because you soon will want to add optional arguments, and then &key is more practical, since you can pass them in any order.
18:41:18
pjb
johnnymaster: for example, you could want to add a key argument to extract the value to reduce from each node.
18:42:04
pjb
(reduce-tree #'+ '("abc" "ab" ("abc" "def")) :key #'length :initial-value (length "prefix")) --> 17
18:47:14
shka
johnnymaster: numerous other sequence functions accept similar arguments, it is beneficial to stick to this set
18:48:11
pjb
What's interesting when you do that, is to compare an school case implementation, to an actual implementation with a lot of special cases and options.
19:20:16
trn
Others too... I finally hacked up from ttyd a proper Web terminal for the Multics emulation. So, you can login with "e Guest", to get a proper terminal, "stty -ttp vt102_132c_50l" and then "wdc invoke" for a proper 132x50 terminal. Enjoy Emacs 12.9 and MacLISP, etc. Now no mosh/ssh/telnet needed :)
19:24:17
trn
No permanent storage for guest users, but, you can have temp space in the process dir ( cwd [pd] )
19:59:57
trn
You can look at https://ban.ai/ - there is mosh/ssh/telnet/web methods, I am not sure the web interface is very stable yet. It already gave me one bus error.
20:00:47
trn
Sadly msot people live in a web browser these days, so this lowers the bar for people to play with it.
20:10:00
trn
Oh, cool. No bug report, I happen to use it, is all. It's part of the tools I haul along everywhere with me and some script or another I wrote uses it.
20:11:43
trn
Thanks, I owe you a beer. I could switch to curl of course, but I don't fix what isn't broken.
21:38:34
Xach
trn: no problem. i wrote it to fetch Dr. Fun comics in cron. that was before web browsers worked all that well.
22:01:55
Josh_2
It wasn't until I finished mine that I realized that one of my algorithms is pointless
22:22:17
Josh_2
Just read the spec one more time, and apparently I have to use 2 different algorithms that do the same thing *bangs head*
23:02:50
resttime
Bike: Ah I've been wondering what you meant about unboxing a simple integer, does it mean just grabbing the pointer to the piece of memory??
23:04:15
Shinmera
resttime: FWIW you can't do fault detection in software if any bit can fail, because the fault detection itself might fail. All you can do is rely on hardware and hope you don't get really unlucky.
23:05:27
Shinmera
Bike: Sure, my point is more that such low-level issues are better left to the hardware and OS.
23:07:23
Shinmera
Also, given by how meticulous NASA is about everything space, I'd be very surprised if they didn't research this as well.
23:07:48
Bike
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.109.3606&rep=rep1&type=pdf doop doop
23:13:48
earl-ducaine
Hi Lispateers! I'm seeing that there's a new version of ASDF out. Yay! I'm also seeing that the standard version bundled with SBCL as rather old.
23:14:46
Shinmera
And the best way is the same as everywhere else. Load the asdf.lisp before the implementation version is loaded.
23:17:40
earl-ducaine
Shinmera: thanks for the info! I was under the impression that SBCL master lagged more than that. Misinformation on my part.
23:18:23
Shinmera
SBCL is somewhat conservative with ASDF upgrades, because ASDF upgrades also tend to break things.
23:18:34
resttime
Bike: Interesting paper, I'll ask about people about it and on the designs some more.
23:19:39
resttime
Not sure though butt makes sense to me since paper says a some processor is like >200,000$
23:20:22
Bike
i feel like if you are moving an object from here to space in the first place, computer costs are probably not the biggest cost
23:22:54
resttime
For a bit closer to lisp now, I've been reading the paper on the Deep Space 1 Remote Agent
23:23:19
resttime
pjb: Oh yeah dunno if you got the msg turns out it was the Harlequin that ran on it
23:24:29
resttime
Which kinda surprised me a bit since I figured generally it's 1 lisp image etc. but maybe I interpreted it wrong
23:28:14
resttime
Errr let me see if I can find paper again it's availble on google might be interesting to read for peeple here
23:30:37
resttime
Oh the other thing I did look at was some powerpoint I found by someone who worked at it I think http://www.flownet.com/ron/RAX2.pdf
23:51:58
resttime
Ugh, need rest zzz but got to finish stuff, I'll look into and think about things more later bye bye
0:49:49
dwts
Hey guys, I'm very new at this, and I'm not sure where to start from. I would like to write a cli tool in lisp (common lisp, probably I'll be using sbcl if that matters) to search results in urban dictionary. After some search I came across this: https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation . Using curl and piping the output to jq (json parser) this gives me a pretty-printed json
0:49:55
dwts
output. How would I be able to mimic the curl part in lisp? Which libraries should I be looking at? any ideas?
0:50:39
dwts
once I get that curl part in lisp I suppose I should be searching for a json parser in lisp as well
1:03:35
dwts
Bike: I'm confused, I'm not sure if hunchentoot is what I'm seeking for. Isn't hunchentoot a webserver say, like nginx or apache?
2:18:21
turkja
Speaking of hunchentoot, now my SSL cert checking application is starting to be in pretty usable shape: https://bitbucket.org/turkja/mitmcheck
2:19:16
turkja
Theoretical question: if i ever wanted to distribute this thing to, let's say windows users, how realistic that would be?
3:00:22
turkja
Guest34211: thanks.. now looking at it, i think it's a good example of why Lisp never conquered the world :) I mean for people who write Lisp programs, setup like that is natural, but for others... not so much :D
3:27:05
aeth
turkja: If C never conquered the world, people would point to its flaws like lack of any safety and the terribly complex way to build things.
3:34:47
turkja
aeth: yeah, you are correct.. historically speaking, i see no reason why lisp is in such a marigin, but as of now, deployment is not very easy.
5:59:07
turkja
jmercouris: some was making a valid not in reddit/lisp: FF57 doesn't anymore have api's needed to run for example Conkeror (afaik - tested it, crash and burn), there definitely is a market for your browser project