freenode/lisp - IRC Chatlog
Search
12:13:22
frodef
phoe: It's why I ask :) Just looking for basic "verify this form returns these values"
12:15:36
phoe
which is a good idea in theory but the fact it has a core written in C makes me wonder if I should ever recommend it for anything more than auto-installing new SBCL versions by means of `ros install sbcl`
12:16:27
phoe
quicklisp autodownloads ASDF systems; roswell manages and autodownloads CL implementations.
12:22:47
jackdaniel
I was curious who put rove on recommended list for unit tests, but apparently "recent changes" on cliki is limited to only few months
12:24:25
jackdaniel
I did not said I have a problem with rove, I've said.. well, you have it written above
13:22:02
beach
It works well with all kinds of testing paradigms, including my favorite one, namely randomly generated operations and comparison to a simple but inefficient implementation.
14:31:20
XenophonF
it's choking on a my package's reference to cl-json, which in Lisp has a package name of "json", not "cl-json"
14:32:42
XenophonF
most of the problems I've encountered up to this point are due to my ignorance, not bugs, so I thought I'd start there ;)
14:47:20
beach
ebrasca: But it is obviously not guaranteed to work. If it were, you could use the personal edition of LispWorks, and figure out all the source code.
14:48:09
jackdaniel
for some reason always when I try to check out the sbcl function I log into Xof's computer :-)
14:57:56
seok
I am trying to move my webserver to cloud, and trying to figure out best way to deploy
14:59:12
jackdaniel
if you have a clean build process then you may want to build it on the host machine
15:00:15
jackdaniel
(putting aside architecture differences, libraries you depend on may be in different locations, so image may get confused, signals may be different so you'd need to do a cold-reinit etc)
15:01:48
jackdaniel
n.b I know as a fact that on AWS instances mutexes were not fair under SBCL, I think that it could be an emulation problem, but we've never got down the rabbit hole to find what's the real problem)
15:02:59
jackdaniel
speaking of a "cloud" - that's just a wet fog which does not belong to you, if you ask me ;)
15:29:43
pfdietz
Trying to add an argument to the constructor that says "default to the slots in this object"
15:37:53
pfdietz
(make-instance 'foo :original obj-to-be-copied :bar 17) ==> copes obj-to-be-copied, but sets the bar slot to 17 instead.
15:39:38
pfdietz
Boa lambda lists let you add extra keyword arguments, and use them in default values for others.
15:44:49
pfdietz
(defstruct (foo (:constructor make-foo (&key (original nil original-p) (bar (if original-p (foo-bar original) nil)))) bar)
15:47:07
ebrasca
It gives me error (:ERROR "Error: The value \"#<CLOSURE (:MACRO SETF) {1000C4388B}>\" is not of type SYMBOL")
15:51:16
ebrasca
with this I get : (:ERROR "Error: The value \"#<FUNCTION (MACRO-FUNCTION SETF) {223DCFCB}>\" is not of type SYMBOL")
16:30:44
ebrasca
This "(swank:find-definition-for-thing (symbol-function 'command-inspect))" does what i need.
16:30:50
Shinmera
but then I don't know what you're doing either. Did you actually try to resolve the definition's source location with definitions:source-location ?
18:43:48
jmercouris
trying to figure out how to do it best, I was thinking Closure may be a good starting point
18:44:04
jmercouris
yeah, that's the problem, the rendering part is a webkit port, or webengine port depending on your choice
18:45:12
jmercouris
jackdaniel: or were you saying that closure uses webkit to calculate position of things etc?
18:45:43
jackdaniel
Xach: froggey created https://github.com/froggey/Iota , so I wouldn't be surprised if he did that ,)
18:46:49
jackdaniel
jmercouris: no, I've just said that "porting" your project to "pure" CL is not possible
18:48:11
jackdaniel
to me "web engine" is what constitues the majority of work (ux is important of course, I'm talking about time requirements though)
18:50:11
jackdaniel
in other words you say: "we have 0.01%, all we should do is to port another 99.99%", htat's what I mean that you'd have to write the browser from scratch
18:51:32
jackdaniel
(again, I'm not saying that UX is not important, for some it might be even the most important thing)
19:20:34
Nilby
I wish I could make my strings with make-string, but "Cannot redefine standard type EXTENDED-CHAR." :(
19:23:58
Nilby
Pretty much I wan the use case that extended characters were put in there for, that of characters with other attributes.
20:48:05
pjb
Nilby: you will have to implement your own make-string function along with all the string operators, to implement them with your strings, and fall back to CL operators for normal strings. Shadow, define your extended-string-lisp package, etc.
20:56:11
Nilby
pjb: Did that. My char-int returns 18138591213958233556254808, so it's probably better that I can't do it anyway.
21:17:37
XenophonF
and if that works, I feel like I have the boilerplate figured out and can start hacking on my web app
21:28:33
phoe
CFFI uses these internally, https://github.com/cffi/cffi/blob/master/src/cffi-sbcl.lisp#L246
21:29:07
emaczen
Nilby: No, like when you have a C variable and the function takes a pointer to that type you just pass the address of that variable with &
21:30:08
White_Flame
just to be clear, are you trying to get the address of a lisp object, or of a C/alien object?
21:30:17
Shinmera
emaczen: int x; foo(&x); == (cffi:with-foreign-object (x :int) (cffi:foreign-funcall "foo" :pointer x))
21:31:40
emaczen
Like if I wanted a pointer to a C string I've been mallocing a word block and pointing to the C string with sb-sys:sap-ref-sap
21:32:01
emaczen
If that is the best way to do this then I guess I can make a macro to reduce the tedium
21:32:21
Nilby
Both C & Lisp always have the address anyway. When you say &var in C, it's just saying don't do the weird thing of passing by value.
21:33:26
phoe
since all pointers are effectively untyped in CFFI, you only specify their type when dereferencing them
21:54:28
aeth
papachan: ##lisp is for the "Lisp" family of languages, #lisp (this channel) is for "Common Lisp".
21:55:27
aeth
(Whether or not Clojure is a Lisp because it doesn't use true conses for its syntax is a minor holy war on the Internet, but ##lisp's topic includes Clojure explicitly so it is on topic there.)
21:56:20
aeth
(Even though in practice ##lisp mostly just #scheme part 2 since most Lisps are Schemes)
22:00:00
Nilby
"I wish Lisp was more popular.", while holding monkey's paw. Mu-hahhaha. Clojure, is knocking.
22:01:31
emaczen
Does anyone know of a standard C function using struct tm that I can test passing by value
22:04:02
Nilby
emaczen: There aren't any. Nor in unix/linux kernel, or most unix-ish C lib. MacOS/iOS and Windows, do though.
22:04:37
phoe
emaczen: you could try writing your own trivial C function, prove that it works properly, and then compile it into a shared object that you then load.
22:06:41
emaczen
I thought about generating a new objc function for every one that passes/returns structs with a pointer
22:08:08
Nilby
Pass by struct seems like weird quirk/misunderstanding of C, which C++ solved by just letting you not have to type literal '&'.
22:10:11
emaczen
Does anyone think generating the equivalent objc methods with pointers instead of struct by values, and then compiling it as a shared object is too dirty? pjb: What do you suggest? fiddlerwoaroof_: what do you think?
22:12:14
emaczen
I just don't like that about 10% of all objc methods have a struct (really only NSRange NSPoint NSSize and NSRect)
22:14:17
Nilby
And I think mostly because it's an optimization becuase those can fit in a register or a few registers.
22:15:33
Shinmera
you can probably get away with a generic un/pack function that you pass a function pointer + args to or something, so you only have to write it for each type of struct to un/pack.
22:19:47
Nilby
Just that you don't have to do the extra de-reference if your struct can fit in a machine word or a couple of words.
22:20:27
Nilby
That way you also don't have to worry about allocation, which we don't worry much about in Lisp anyway.
22:23:33
Nilby
To pass a struct by pointer, you have to allocate it in stack or heap, and then dereference it at least once, probably more. To pass by value, if it's small enough you can just cram it in registers and then call the function.
22:28:10
Nilby
It does vary with ABI, so the way that it works could theoretically vary based on which complier, but there is a fairly standard way that's documented in, for example the Intel archetecture. Note that a Lisp FFI may have to do multiple ABIs.
22:28:44
emaczen
pjb: Why? I was just going to generate objc code by literally (with-open-file (format ) ....) then (run-program gcc ...) to compile it as a shared object
22:29:05
Nilby
I had the misfortune of coding in C a lot before any C compiler could pass by struct.
22:32:26
emaczen
pjb: For example, with -(void)drawRect:(NSRect)aRect I could define -(void)drawRectPointer:(NSRectPointer)ptr and the implementation of drawRectPointer: would just call drawRect: by dereferencing the pointer
22:36:27
Nilby
But of course saying there are no pointers, is not really true, just like in Lisp. But really more like: let the compiler figure it out.
22:39:13
|Pirx|
java has this "inner classes" thing because they have no pointers, but they're really a pointer
0:00:00
harovali
hi! trying to run cl-ncurses, my distro fails to provide the /usr/lib/libncurses.so file the library asks for. There are other files in my /usr fs which could be equivalent to what cl-ncurses expects, but I'm trying blind on it, any helpis welcome