freenode/#lisp - IRC Chatlog
Search
16:03:10
beach
jmercouris: Common Lisp doesn't have a preprocessor, and as the page explains, it is undefined when the object is coerced.
16:06:18
jackdaniel
no, casting is change of interpretation, while coerce may create brand new object
16:06:48
jmercouris
and will convert one object type to an equivalent representation of another if necessary or possible
16:07:49
Bike
it's kind of hard to define what coerce does quickly and completely. it does a couple different things.
16:07:57
jmercouris
I'm not even close to the level where these details will make a huge difference to how I think
16:09:08
beach
In addition, it is not required that COERCE be called to coerce a designator to the designated object.
16:09:32
jackdaniel
jmercouris: coerce is basically a converter – if implementation knows how to convert your object to the desired type, it will.
16:10:11
jmercouris
why allow (require :one-way) and (require "one-way") what's the advantage of having a coercible form?
16:10:18
beach
jmercouris: If the designator is already the right type for the designated object, the original object can be used.
16:11:01
jackdaniel
jmercouris: convenience. also require and provide are both deprecated in the standard afaik
16:11:51
_death
in C++ the possible coercions are given different operators.. static_cast/reinterpret_cast/const_cast/dynamic_cast
16:13:29
jmercouris
Ok, and what mechanisms do they use to load in symbols from different files if not require?
16:15:41
jmercouris
Ah okay, so it has to do with some sort of low-level modules not written in lisp?
16:18:27
jmercouris
jackdaniel: does there exist something like the objective-c bridge in CCL for ECL?
16:18:39
_death
jmercouris: say the lisp implementation doesn't build with asdf.. then it may use the mechanism provided by the standard
16:19:36
pjb
jmercouris: also you would have to distinguish Apple Objective-C version 2 run-time from GNUstep and gcc Objective-C version 1 (or 2) run-time.
16:21:00
jmercouris
I feel like I could make a python bridge or something, but something like the objective-c runtime is a complete blackbox to me
16:21:59
jmercouris
beach: that's the plan, I want to touch this kind of code as little as possible, but I must interface directly with some libraries on OSX
16:22:50
jmercouris
I'll use CCL for now, but I'd like to make my code as portable and as isolated as possible as we were discussing about McClim earlier
16:24:44
pjb
Easy: don't spread you objective-c bridge code all over the place: put it all in a single file or package, inside normal lisp functions, and call them from the other modules.
16:25:08
pjb
Then you can change the implementation, possibly even using another framework than cocoa on a different platform.
16:25:47
jmercouris
pjb: yeah, I will like to isolate to one file, I've been thinking about it for the past two days how to do it
16:26:19
jmercouris
pjb: here's the bridge code: doesn't look like it'd be an insurmountable task: https://trac.clozure.com/ccl/browser/trunk/source/objc-bridge
16:27:45
jmercouris
I will have to come up with my own API/interfaces, hence why I was talking about that McClim stuff earlier
19:11:19
lambdice
hi all, i do you know how to get the equivalent of the function 'class-precedence-list' on sbcl ?
19:15:01
Xach
(apropos "class-precedence-list") shows some promise, and look for things with ":" rather than "::" usually. (even a ":" is no guarantee of supportedness though.)
19:20:57
jmercouris
lambdice: here's an example of my project which has a few dependencies: https://github.com/nEXT-Browser/nEXT/blob/master/next/next.asd and then here is how someone runs it, pullin in those dependencies as necessary: https://github.com/nEXT-Browser/nEXT/blob/master/next/run.lisp
19:21:24
pjb
lambdice: what I do: - add a generate.lisp script that will quickload my asdf system; - add a Makefile to invoke the generate.lisp correct; - add a README telling to do make application to build the application. - push everything on some git repository.
19:21:59
pjb
lambdice: your asdf system and its quicklisp dependencies will ben dealt with automatically in generate.lisp by a ql:quickload of your system.
19:22:15
pjb
lambdice: if you have other kinds of dependencies, you can add what is needed in it to fetch them.
19:23:06
lambdice
yeah i want to share the give the application to someone, and i know the guy just have sbcl installed
19:24:03
Xach
lambdice: another option is quicklisp "bundles", where you can put a set of libraries into a self-contained directory tree
19:25:05
pjb
lambdice: see for examples: https://framagit.org/patchwork/patchwork (it's a complex case, with a separate repo to get dependencies: https://framagit.org/patchwork/scripts ), or https://framagit.org/nasium-lse/nasium-lse/tree/master/src with https://framagit.org/nasium-lse/nasium-lse/tree/master/dependencies (several different executables built (server/client)).
19:25:58
lambdice
Xach: well i mean, lets say.. i wrote a game in common lisp, using cl-sdl2 and other stuff
19:26:52
Xach
Ok. I don't know how best to do that. but people do use lisp to make games, so maybe there is some insight from those people.
19:27:41
Xach
lambdice: it is usually far more challenging to make something someone else wants to run, than to actually make it available for them to run.
19:28:00
Colleen
Unknown command. Possible matches: 8, say, mop, time, tell, roll, help, deny, clhs, login,
19:28:57
pjb
lambdice: you may get more specific answer in #lispgames even for packaging your game releases.
19:30:07
lambdice
well lets say fo cl-sdl2 my first try was like, create an install.lisp, that will run quicklisp to install cl-sdl2
19:36:21
jmercouris
but it produces nice little standalone binaries, and it is easy to get started with
19:36:53
jackdaniel
lambdice: EQL may be used from any implementation via swank protocol. I've encountered such mention in its documentation
19:39:09
jackdaniel
lambdice: here you have a sub-paragraph giving overview on CL GUI solutions: https://common-lisp.net/project/mcclim/involve
19:41:03
jmercouris
It becomes a question of a Theseus type ship though, if we modify a GUI toolkit enough to interface it with lisp, is it still the same toolkit?
19:41:06
oleo
mcclim is the only one written in common-lisp and using only standard backends like clx
19:41:35
jmercouris
Again though, I guess it depends on what views you are trying to support, does McClim have a web-view for instance?
19:44:05
jmercouris
lol the way you phrased that it sounds like you are waiting to push changes that add instability :D
19:44:40
jmercouris
oleo: What OS? Also depending on how you install QT, it can really vary the stability
19:44:53
jmercouris
it also depends on how you are treating and handling the objects, some behaviors are allowed, but dangerous
19:47:42
oleo
anyway, mcclim works for me and does the things i expect of it albeit some features not working or not being implemented
19:48:47
oleo
one has to be already fluent in oop in order to understand all the hooks and judge if something is wrong (logic or otherwise)
19:50:14
oleo
for example there is a Drei/lisp-syntax.lisp in which there is a func named perenthesis-highlighter or so
19:52:13
oleo
i only replaced it with an ink, such that it draws stuff with some ink (which is the lighter version of my foreground ink, and my background ink is black)
20:13:59
emaczen
how would I create an initialized C array, i.e. type name[size] = {v1, v2, ... vsize}
20:18:14
oleo
they have very different ideas and expectations about types, sometimes you have to even intervene manually in cffi
20:39:49
oleo
https://common-lisp.net/project/cffi/manual/cffi-manual.html#with_002dforeign_002dobject
20:45:07
oleo
emaczen: and even if it's probably not an exported symbol, so not exposed and as such not an api function
21:00:47
chream_
Hi, I am having some troubles with emacs and ecl. When trying to load some systems it unexpectedly disconnects me from ecl and the server stops. The only info I get is from the swank server: Illegal instruction: 4. I seem to have traced the problem to cffi. Has anyone had this before? Also, one clue might be that I recently installed many native GNU command line tools on my mac. Has anyone had any troubles with this before?
21:02:00
chream_
Lastly, the systems apparently install fine when I tried outside emacs and slime. Might be a emacs problem then?
21:02:59
chream_
Also, everything works on other implementations. (works on sbcl, got an unrelated heap error for allegro)
21:09:54
Shinmera
Well if you use CFFI or other stuff that directly manipulates memory, you might corrupt the implementation badly, leading to a crash.
21:10:36
Shinmera
Might also be a bug in ECL, or the library not being adapted to certain ECL specific things.
21:12:07
jackdaniel
recent changes to slime (didn't find time to narrow them yet) shown some ECL problems. probably my last pull request to slime repository
21:27:13
asarch
Common Lisp has CLOS, Emacs has "Enhanced Implementation of Emacs Interpreted Objects"
21:47:57
aeth
I can't say this: (defstruct foo (bar (make-array +foo+ :element-type 'fixnum) :type (simple-array fixnum (+foo+))))
21:48:54
aeth
I can e.g. say this: (defstruct foo (bar (make-array (list +foo+ 4) :element-type 'fixnum) :type (simple-array fixnum (42 4))))
21:49:30
aeth
So I can get around the problem of make-array for 2D arrays where '(+foo+ 4) will obviously not work, but I can't get around the problem of type in a defstruct for any dimension arrays if there's a constant instead of a number for the size
21:50:14
aeth
The problem is that defstruct doesn't quote the type in :type so I can't e.g. `(,+foo+) or (list +foo+)
22:11:10
aeth
The best alternative if there's no workaround would probably be to define (gensym) types with the struct