freenode/#lisp - IRC Chatlog
Search
5:38:50
GoldRin
Bah, simple question, just having trouble with syntax. How would I apply an initial expression to an arugment within an flet in common lisp.
5:40:52
GoldRin
Basically just this: (let dup ([i 0]) ... I just don't know how I would translate from scheme to CL.
5:41:53
loke
I thought Scheme used the same syntax for LET as Common Lisp, but that's not a notation I'm familiar with.
5:42:33
GoldRin
local binding for a function named "dup" with the argument i which is initialised to 0 and local to "dup"
5:44:20
GoldRin
(I suck at IRC, so I hope this works) loke: I've found that scheme and CL have slightly different ordering of parenthesis and it just has been throwing me off.
5:45:46
d4ryus
GoldRin: if you want to call dup from within dup, you have to use labels. labels/flet is like let*/let respectively
5:51:18
GoldRin
Alright, I think I need to do some more reading and research then. This isn't anything really important at least.
5:51:50
pjb
(let dup ((d '()) (e l)) (if (null? e) d (dup (cons (car e) (cons (car e) d)) (cdr e)))) would be written: (loop :named dup :for x :in e :collect x :collect x)
5:52:37
beach
GoldRin: The Common Lisp standard does not require tail-call optimization, so you can't rely on that. Plus, tail-recursive functions are often less readable form of iteration.
5:53:49
loke
GoldRin: Also remembe rthat you really shouldn't do looping with recursion in Common Lisp. Instead, CL has a very strng LOOP construct that should be used.
5:55:22
beach
loke: You are right when it comes to linear structures. But it is common for tree-like structures.
5:58:09
beach
GoldRin: Scheme and Common Lisp are very different languages, especially when it comes to what is considered idiomatic code. It is preferable not to have a "Scheme accent" when you "speak Common Lisp".
6:01:33
beach
I am willing to bet that object-oriented programming is used a lot more in Common Lisp than in Scheme. I may be wrong about that, of course.
6:02:22
GoldRin
Well I'm not highly familiar with either, just I had studied scheme for a bit before studying common lisp. Thanks for all the info btw
6:04:48
loke
GoldRin: Common Lisp is a multiparadigm language, while Scheme is more of a "true" functional language (if there is such a thing)
6:05:20
pjb
beach: of course, 1- CL has a standard object system. 2- CL has the best object system of the world. :-)
6:08:51
GoldRin
I hadn't been using CLOS specifically, but when I reached the functional programming part of the CL book I'm going through, I guess I just assumed that scheme ideas would just translate over.
6:11:17
pjb
GoldRin: the only thing that doesn't translates well in CL from scheme, are generalized continuations. Delimited continuations are ok.
6:12:16
GoldRin
Yeah, I've heard about that. I never really got too far with continuations when I was studying scheme, but I'll probably go back once I've finished this book.
11:24:05
Godel[m]
When managing quicklisp with roswell, is it expected to symlink the project directory to local-project directory both in `~/.roswell/local-projects` and `~/.roswell/lisp/quicklisp/local-projects` ? That is the only way I can see to load the project via quicklisp in both slime and ros-repl.
11:26:07
no-defun-allowed
I usually symlink stuff into ~/quicklisp/local-projects to get them recognised by Quicklisp, and it does seem intentional given the pathname and that there's a function QL:REGISTER-LOCAL-PROJECTS so I'd guess so.
11:29:08
jackdaniel
Godel[m]: I think you'll get more lucky by pasting question on roswell repository
11:31:09
Godel[m]
jackdaniel: I think I solved it. But now I'm having trouble with `~/.sbclrc` which doesn't load on startup anymore (once I installed quicklisp and sbcl via roswell).
11:32:43
flip214
How would I access an Oracle DB from sbcl? I know about PostModern etc., but the best choice for Oracle is CL-DBI? does CLSQL work?
11:33:47
no-defun-allowed
If it uses the SQL wire protocol (which IIRC is a standardised thing), probably.
11:33:51
jackdaniel
Godel[m]: I've tried roswell and I had a lot of problems like that (so the experiment lead to software rejection)
11:35:00
no-defun-allowed
I tried to work on refactoring some code in Roswell and it was very nasty. Maybe that is just how "contrib" code goes being a lower priority, but it doesn't make me think too nicely of Roswell as a whole.
11:35:49
no-defun-allowed
And I basically spend all my CL work time in git or SLIME so I don't see why I want a Unix-y interface to CL system management either.
11:35:52
flip214
no-defun-allowed: what is an "SQL wire protocol"? every database has it's own (binary) protocol. I don't know about something like TELNET for SQL.
11:36:19
no-defun-allowed
Oh, maybe it isn't a standardised thing. I assumed every database used the same protocol.
11:37:27
no-defun-allowed
In the output of (ql:system-apropos "oracle") I see "dbd-oracle" and "hu.dwim.rdbms.oracle" which look promising though.
11:40:58
aeth
I like the concept of Roswell, but the implementation is a very buggy C program that's hard to upgrade. Someone should make a similar tool that assumes that the host already has a Common Lisp installed, just not literally every Common Lisp ever. That would greatly simplify things imo.