freenode/#lisp - IRC Chatlog
Search
12:35:13
jmercouris
however it did not automatically load fiveam even though the system app/test depends on it
12:35:44
jmercouris
do I have to first do (ql:quickload "app/test")? and then (asdf:test-system "app")?
12:37:17
scymtym
it should work once fiveam is installed. i think ASDF:TEST-SYSTEM is not hooked up to install systems via quicklisp
12:42:18
ecraven
maybe check the source? I'm no expert, but I've found some information I sought in the sources, they seem approachable
12:43:43
phoe
I don't really know where to start in the source. All I know that slime-company shows "function" as being bound as a type, and I don't know where it gets that information from.
12:45:13
jackdaniel
phoe: grep for "defimplementation find-definitions" and "defimplementation find-source-location"
12:48:28
phoe
jackdaniel: this still doesn't answer my question. For instance, (swank::find-definitions 'member) only lists a DEFUN, a DEFTRANSFORM for sequences, and SBCL's DEFKNOWN.
12:49:45
phoe
And swank obviously knows which symbol is defined as a type and which are not. That knowledge doesn't seem to come from SWANK::FIND-DEFINITIONS though.
12:54:32
moldybits
ah, when i update a macro i need to reevaluate all the procedures that use it, too.
12:58:12
phoe
okay, found it: https://github.com/slime/slime/blob/e6d215d77148079799d2fc3253ef402b5d9ed4d7/contrib/swank-util.lisp#L42
13:00:33
schweers
I build my program with asdf:make. Is there a way to use core compression when using sbcl?
13:05:54
schweers
Sorry, I (sorta) lied. I have a :build-operation and :build-pathname directive (is that the correct term?) in my system definition
13:07:41
schweers
I must have copy and pasted this from somewhere. I’m afraid I never really understood how asdf does these things.
13:09:23
phoe
I use Shinmera's deploy that has this baked in: https://github.com/Shinmera/deploy/blob/7bd96ba3f88a424e03394de1adadf4a4993f849c/deploy.lisp#L153
17:56:07
jkordani
what kind of literature do I need to understand the why behind this? https://github.com/marcoheisig/simplified-types/
18:06:44
shka_
however, you can have type (integer 0 42) which implies that said type is integer from 0 below 42
18:07:50
shka_
in other words type INTEGER is superset of (INTEGER 0 42) because it contains every possible (INTEGER 0 42) and then some
18:11:40
shka_
it gets more complicated, but take a look at that: https://github.com/marcoheisig/simplified-types/blob/master/test-suite/random-types.lisp
18:12:42
pjb
It's bullshit: (simplify-type '(or (eql 0) (member 1 3 5) (and integer (satisfies evenp)))) #| --> (integer * *) |#
18:13:49
pjb
But I can do this myself in my head: (simplify-type '(or (eql 0) (member 1 3 5) (member 2 4 6))) #| --> (integer 0 6) |#
18:16:39
jkordani
I get that... it uh... can take type specifications and a heirachy and reduce a given one to a simpler form but I don't understand why this is useful, and not from a learned perspective.
18:18:41
shka_
jkordani: well, for picking the type optimized implementation, for checking compatibility of types in the generated code and so one
18:23:24
shka_
https://github.com/marcoheisig/restricted-functions/blob/700d7e3275681e631bc7e778d6473ef8d942f214/code/strategies.lisp#L17
18:24:20
pjb
jkordani: it's not useful if you are the one specifying the types, but sometimes you get types from other places, and it may be useful to simplify their conjonction or their disjonction.
18:30:49
pjb
Yeah, rather useless: (simplify-type '(or short-float single-float double-float long-float)) #| --> t |#
18:33:53
sjl_
That's because there's no `float` in the simplified hierarchy in the readme, I'd imagine
18:34:35
sjl_
Which is presumably because doing something like (make-array ... :element-type 'float) isn't particularly helpful
18:35:46
sjl_
And including `float` in the hierarchy would break the disjointness guarantee mentioned in the readme.
19:50:25
emaczen
Ok, I can successfully (#/initWithFrame: (#/alloc 'ns-text-field) (make-ns-rect 10 10 600 800)) and then
19:50:25
minion
emaczen, memo from fiddlerwoaroof: I've looked into Obj-C exceptions, but I don't think there's anything you can really do about them
19:50:25
minion
emaczen, memo from fiddlerwoaroof: see the recent-ish comments in #ccl from eschatologist
19:51:46
emaczen
I can draw this NSTextField to a window and everything works (I can type in it etc...)
19:53:19
emaczen
If I try the same with a NSTextView, Immediately after calling #/initWithFrame: I get signal 11
20:04:09
emaczen
minion: memo for fiddlerwoaroof: I briefly looked at NSException.h which has the macro definitions for exception handling, and it looked to me that all you have to do is just translate the macro definition into lisp
20:04:57
emaczen
minion: memo for fiddlerwoaroof: the translation entails defining the C struct for an execption and some function calls
20:32:22
emaczen
slyrus_: Yes, but I need to learn more about when and how to get control of the main thread
20:33:23
eschatologist
minion: memo for emaczen: Don't try to bridge NSException to Lisp, it'll only end in tears, Objective-C exceptions *are not meant* to be handled
20:33:25
emaczen
It appears that the CCL bridge is more tolerant of not executing GUI code on the main thread too
20:33:25
minion
emaczen, memo from eschatologist: Don't try to bridge NSException to Lisp, it'll only end in tears, Objective-C exceptions *are not meant* to be handled
20:34:35
eschatologist
It really sounds like you're trying to bridge NSException and Lisp conditions or something though.
20:34:59
eschatologist
Which, really, you can't. As soon as an NSException is raised/thrown, you need to treat process state as corrupt.
20:37:17
eschatologist
So when an exception is thrown none of the intervening stack frames etc. between the throw and the eventual catch are likely to do whatever housekeeping is needed to keep the process going.
20:37:45
eschatologist
(Trust me on this, 22 years of NeXT/Cocoa experience, and I've work on tools and frameworks at Apple.)
20:38:43
eschatologist
GNUstep is an entirely independent implementation but it almost certainly has all the same constraints.
20:39:38
eschatologist
Since none of the OpenStep APIs GNUstep implemented had any definition about exception safety, there's probably no consideration for it in the implementation.
20:40:52
eschatologist
That trivial-main-thread thing on Github also propagates a common myth, "only thread 0 is allowed to issue drawing calls." The reality is WAY more subtle and stating things in that fashion is likely to lead to people writing bad code. (E.g. people assuming things like "calls that don't draw are safe from multiple threads.")
20:41:42
emaczen
eschatologist: Yeah, which is why I couldn't just (#/initWithFrame: (#/alloc 'ns-text-view) (make-ns-rect 0 0 600 800))
20:43:17
emaczen
I'm using sb-thread:interrupt-thread (sb-thread:main-thread) (lambda () ...) and the equivalent ccl:process-run-function for CCL
20:44:35
eschatologist
The critical part is actually having a view in a window and having that window onscreen.
20:44:36
eschatologist
You don't manage the event loop yourself in Cocoa, the framework manages it for you.
20:44:55
jmercouris
eschatologist: not always, not when you have an opengl loop within a cocoa window
20:45:33
emaczen
eschatologist: I only briefly looked at the CCL bridge and to me it looked like they subclassed NSApplication and defined a selector called #/lispInterrupt
20:48:08
emaczen
eschatologist: Well, what are other possible reasons that nothing happens to my window when I create an NSTextView and then send #/addSubview or #/setContentView appropriately?
20:54:34
emaczen
If I uncomment the lines regarding the NSTextView, I can have an NSTextView in my window
20:55:00
emaczen
I want to just run the code as is, and then create the NSTextView and add it to the window from the REPL
21:00:03
eschatologist
Are you creating the NSTextView and setting your window's contentView from within the main thread?
21:03:00
emaczen
eschatologist: The result of evaluating that in the REPL is nothing on the window, and no logs in *inferior-lisp* either
21:03:08
eschatologist
Yeah, can't tell you why that wouldn't work. I assume you know that an NSTextView isn't a complete text stack with a scroll view, clip view, etc. like you'd get in a xib file, right?
21:04:28
emaczen
But I think I know what you mean since I have manually added a NSScrollView etc to a NSTextView before
21:04:48
eschatologist
(Also the Lisp bridges really need to update to using libclang to parse the modern headers or something so they can do things like `(setf (window contentView) textView)` instead of having use #/ to explicitly call setters.
21:06:35
eschatologist
emaczen: I would suggest in the strongest possible terms that you work through a couple Cocoa-with-Xcode-on-macOS tutorials using Interface Builder and so on. NeXT's frameworks were always very opinionated about how you should work with them and Apple has continued that tradition, and trying to work in a different way will be fighting them.
21:06:52
eschatologist
That doesn't mean you need to use Interface Builder for your own stuff, but it does mean you need to know everything that IB is doing for you, intimately, so you can do it yourself.
21:12:50
eschatologist
One thing I'd notice as an IB user is that I *never set the contentView of a window*.
21:17:37
emaczen
I think this is a thread problem because if I just put a (format t ....) form as the first form in the body of the (with-main-thread ...) I never see anything printed...
21:22:21
fouric
no-defun-allowed: cool! now, does that mean that i can actually COMPILE two files in two threads simultaneously, or is still a ways off?
21:33:29
moldybits
i want to make a new list of N elements, each provided by a procedure, like: (make-list 3 :initial-element-producer (lambda () (random 10))) => (4 7 2) ; what's the canonical lisp way?
22:18:08
aeth
verisimilitude: At that point you might as well just (lambda () (random 10)) as the function
22:32:22
makomo
what's the usual idiom when you want to "merge" multiple "multiple values"? e.g. i would like for (values mvs1 mvs2) to merge all of the multiple values returned by mvs1 and mvs2 and return them all as multiple values
22:35:07
aeth
verisimilitude: Clever code is generally discouraged in any language. Except maybe Perl.
22:40:04
aeth
Is a "hey look how cool this language is" demo posted on a blog what you'd typically see in production, though?
22:40:22
verisimilitude
No; it's my understanding you usually get an uninteresting mess in production.
23:13:50
jasom
I've seen clever code in production; fortunately it was well commented. It also wasn't more clever than necessary
23:37:13
jmercouris
has anyone figured out how to get slime to avoid opening new windows and randomly moving things around?
23:37:32
jmercouris
I looked at using shackle, but slime makes several buffers and windows, so I am not sure how to configure it
23:41:30
jmercouris
I literally have to register my window configuration every time I am about to open up slime because I know it will ruin everything