freenode/#lisp - IRC Chatlog
Search
15:39:23
Bike
You cannot pass a reference like you can in C++. You can only pass values as arguments.
15:39:51
Bike
You can do things like (let ((x 2)) (print x) (funcall (lambda () (setf x 5))) (print x)), which will print 2 then 5.
15:40:42
Bike
Lisp just does not have references. You can pass objects and modify objects: (let ((x (cons 2))) (print (car x)) (funcall (lambda (c) (setf (car c) 5)) x) (print (car x)))
15:41:16
Bike
But lisp has an entirely different model of things from C. Variables do not "have addresses".
15:42:03
asdf_asdf_asdf
@Bike; Did it mean, that every time variables has different/other/another addresses?
15:45:18
Bike
If you write something like (let ((x 2)) ...) for example, there's nothing stopping the compiler from simply storing 2 in a register, or perhaps using a different register for the same variable in different places, or maybe it will put it on the stack, or maybe it will eliminate the variable entirely and the value won't even exist in a register.
15:47:56
asdf_asdf_asdf
OK. So, why in SBCL are instruction such as get-lisp-obj-address, int-sap, etc?
18:08:12
minion
The URL https://gitlab.common-lisp.net/users/sign_in?secret=69fe575d will be valid until 18:15 UTC.
18:10:01
minion
The URL https://gitlab.common-lisp.net/users/sign_in?secret=69fe575d will be valid until 18:15 UTC.
19:13:30
asdf_asdf_asdf
Hi again. (describe (function sb-alien::define-alien-callback)). How it fix?
19:13:50
asdf_asdf_asdf
The :macro name SB-ALIEN::DEFINE-ALIEN-CALLBACK was found as the argument to FUNCTION.
19:18:10
verisimilitude
Based on the message you gave, you're giving an invalid argument to FUNCTION, it seems.
19:18:28
verisimilitude
My suggestion, asdf_asdf_asdf, is to avoid writing C when one is ostensibly writing Common Lisp.
19:22:53
jonatack
asdf_asdf_asdf: http://www.sbcl.org/manual/index.html#Step_002dBy_002dStep-Example-of-the-Foreign-Function-Interface
19:29:38
asdf_asdf_asdf
Thanks all for help. Especially kpoeck, it works. Thanks. I thinked, that is a fuction not a symbol.
20:08:03
asdf_asdf_asdf
Hi again. Which function is to definition callback without body? https://cpy.pt/F8nzKM7a
20:13:56
asdf_asdf_asdf
Lambda-list: (SB-ALIEN::NAME SB-ALIEN::RESULT-TYPE SB-ALIEN::TYPED-LAMBDA-LIST)
20:43:26
puchacz
asdf_asdf_asdf: how about (matmul #2A((0.0 1.0) (2.0 3.0)) #2A((5.0 6.0) (7.0 8.0)))
22:49:15
no-defun-allowed
And if you're going to use SBCL internals, #sbcl is probably more appropriate, else please use CFFI (and cffi:defcfun).
22:53:52
no-defun-allowed
Now, could you do us a favour and learn Common Lisp before trying to get FFI working please?
22:55:19
no-defun-allowed
That's all I have to say. Sorry, it's not very nice, but you are better served using C if you solely want to call C from SBCL.
22:57:05
no-defun-allowed
No, I can't, but I really think you should learn Lisp before trying to learn how to use any FFI.
22:57:38
no-defun-allowed
Using unportable SBCL internals (which aren't even external to sb-alien!) is a bad idea too.
22:59:34
asdf_asdf_asdf
No, because I want learn to assembly x86-64 and yourself write instructions for example to Common Lisp.
23:03:32
no-defun-allowed
SB-ALIEN isn't portable, so it's not on topic for #lisp, and it's certainly not a good move for users of other implementations like Clozure CL.
1:08:08
jeosol
(setq inferior-lisp-program "/usr/local/bin/sbcl --dynamic-space-size 10000") -- does this command start sbcl in slime with ~10G. I am running a memory intensive case and slime hangs, but with "sbcl --dynamic-space-size 10000" things work but not able to debug well
2:32:44
mgsk
jeosol: yes, you can allocate up to 10GB on the heap. Are you saying it does or does not work?
3:03:29
sukaeto
aeth: Sure! I see your point. It depends on what you're doing with said HTML. HTML templating engines like Djula still have value, though (as evidenced by Djula's existence - someone wanted Jinja style templates in Lisp), because you can just have your design person write the templates without needing too much from you.
3:04:27
sukaeto
whereas sqlalchemy (at least from my experience with it) is just kind of very not ideal way of allowing you to write queries in Python. There's nothing about it that sxql doesn't do better.
3:06:34
sukaeto
pjb: "Just using pointers to structures for everything", while possible in Ada, is very awkward and you have to go out of your way to do it. For good reason, IMO. I wouldn't call Ada a lesser language (than Lisp, presumably you meant to say). Just . . . different.
3:09:37
sukaeto
aeth: Ada distinguishes between "Foo", "pointer to Foo", and "Foo'Class (as well as pointer to Foo'Class)" - that last one I've never seen an analogue to in any other language. Essentially, "We don't know the exact type of this thing until runtime, just that it's some descendent of Foo"
3:36:14
aeth
sukaeto: On the other hand, nothing's stopping you from, rather than text-substituting, parsing that templating engine into your html->s-expression system and thus validate the HTML