jarcane
2019-8-2 07:58:03

on a Mac, and my Slideshow presentation is running 1) on the opposite screen from DrRacket, and 2) not properly centered and fullscreen, so it cuts off the top of the slide


jarcane
2019-8-2 08:38:23

Even if I run slideshow from the terminal it still spawns a not-fullscreen window that’s cut off at the top


soegaard2
2019-8-2 10:37:54

@jarcane Did you use slideshow -M0 or slideshow -M1 to choose your screen?


soegaard2
2019-8-2 10:39:00

A bit confusing --fullscreen means 4:3 and --widescreen means 16:9


jarcane
2019-8-2 10:39:32

Well, I tried first running from DrRacket, and it always picks the opposite screen


jarcane
2019-8-2 10:39:44

I didn’t know about those options for my commandline attempt


jarcane
2019-8-2 10:40:02

I’ve wound up just using Spectacle and the Cmd+Opt+F to fullscreen the window that way


soegaard2
2019-8-2 10:41:30

Haven’t tried with DrRacket — but you can provide “command line arguments” in DrRacket too. In the menu “Language” choose “Choose Language…” and then click the button “Advanced”. If I recall correctly there is a text field for command line arguments.


soegaard2
2019-8-2 10:42:03

But using Spectacle seems practical.


jaklingonzal
2019-8-2 11:55:52

Why did Apple remove all non-Thunderbolt 3 ports? :thinking_face: http://snip.ly/u52g4r


jarcane
2019-8-2 11:58:08

because aside from backward compatiblity there’s little need for anything else


jarcane
2019-8-2 11:59:03

once upon a time people made all the same grumbles about USB


mark.warren
2019-8-2 12:19:01

Hello again, I’m trying to go through PAIP and I’m trying to write the common lisp function some, this is the code I’ve got (I think it works ok), but it’s not very elegant. Any ideas how to do it better? (define (some fnc lst1 lst2) (for/or ([itm1 lst1]) (for/or ([itm2 lst2]) (apply fnc (list itm1 itm2)))))


soegaard2
2019-8-2 12:32:43

(apply fnc (list itm1 itm2)) is the same as (fnc itm1 itm2)


soegaard2
2019-8-2 12:33:40

I like naming lists xs (a list of xes) and then letting x be name of an element of the list xs.


soegaard2
2019-8-2 12:34:20
(define (some f xs ys)
  (for/or ([x xs])
    (for/or ([y ys])
        (f x y))))

mark.warren
2019-8-2 12:34:50

@soegaard2 Nice one thanks.


laurent.orseau
2019-8-2 12:35:11

using for*/or would be slightly simpler


soegaard2
2019-8-2 12:36:17

It doesn’t do the same as the common lisp version though.


mark.warren
2019-8-2 12:36:58

@laurent.orseau Good call, looks nicer.


soegaard2
2019-8-2 12:36:59

I think this one works: (define (some f xs ys) (for/or ([x xs] [y ys]) (f x y))


soegaard2
2019-8-2 12:37:24

And that’s the same as or-map ?


laurent.orseau
2019-8-2 12:37:48

That’s different from the code above, isn’t it?


soegaard2
2019-8-2 12:37:49

ormap !


soegaard2
2019-8-2 12:38:18

Yes, but it was supposed to be the same as some so I looked it up: http://clhs.lisp.se/Body/f_everyc.htm#some


mark.warren
2019-8-2 12:38:32

@soegaard2 I’ll check that out, I’m looking at the common lisp hyperspec for the definition.


soegaard2
2019-8-2 12:39:42

In Common Lisp (some #'= '(1 2) '(2 1)) will be false. But in your initial version (I think) it will return true.


mark.warren
2019-8-2 12:41:26

@soegaard2 Yes it is possible I’ve misunderstood the functionality.


mark.warren
2019-8-2 12:42:29

The hyperspec says ‘some returns the first non-nil value which is returned by an invocation of predicate. If the end of a sequence is reached without any invocation of the predicate returning true, some returns false. Thus, some returns true if and only if some invocation of predicate returns true.’


mark.warren
2019-8-2 12:43:03

And it gives an example (some #'= '(1 2 3 4 5) '(5 4 3 2 1)) => true


soegaard2
2019-8-2 12:43:52

Try comparing (for/list ([x ’(1 2 3)]) (for/list ([y ’(a b c)]) (list x y)) with (for/list ([x ’(1 2 3)] [y ’(a b c)]) (list x y))


soegaard2
2019-8-2 12:44:11

In that example the two 3’s have the same index.


soegaard2
2019-8-2 12:44:43

It computes (or (f x0 x1) (f x1 y1) (f x2 y2) …)


soegaard2
2019-8-2 12:44:52

So there is no nesting.


soegaard2
2019-8-2 12:45:45

Corrected the example - wrote the same thing twice.


mark.warren
2019-8-2 12:46:54

Hmmm… I was reading it as ‘does the second list contain some of the values in the first list’, but you seem to be saying (if I read it right) ‘does the second list contain some of the values from the first list in the same position’. Does that sound right?


soegaard2
2019-8-2 12:47:06

yes


mark.warren
2019-8-2 12:47:13

Ok


mark.warren
2019-8-2 12:49:15

So your example would return true if you made it (some #'= '(1 2 3) '(3 2 1)) because of the 2’s in the middle position.


soegaard2
2019-8-2 12:49:28

yes


mark.warren
2019-8-2 12:49:38

Ok, cool, I get it now.


soegaard2
2019-8-2 12:50:49

CL some is Racket ormap and CL every is Racket andmap.


mark.warren
2019-8-2 12:51:11

That would make life easier, thanks.


laurent.orseau
2019-8-2 12:54:52

everything else is Racket for*/fold :stuck_out_tongue:


soegaard2
2019-8-2 12:57:53

Is that a challenge?


mark.warren
2019-8-2 13:00:27

Hehe


soegaard2
2019-8-2 13:01:03

Laurent is right. I think even unfold is a for/fold ?!?



soegaard2
2019-8-2 21:32:54

Grammar question: Is color-and-stops or colors-and-stops the better choice?


sorawee
2019-8-2 21:56:51

I thought that stylistically, + is preferable over -and-


sorawee
2019-8-2 21:57:28

which is also interesting now that I think about it. & would be more accurate


sorawee
2019-8-2 21:59:27

Is s distributive? What about <color-and-stop>s?


soegaard2
2019-8-2 22:00:33

Maybe color-stops is better?


soegaard2
2019-8-2 22:01:08

It’s for the name of a struct, so I am not too fond of + which usually indicates a functions that returns two values.


edward.hughes1911
2019-8-2 22:46:17

@edward.hughes1911 has joined the channel


samdphillips
2019-8-3 03:27:14

+1 for color-stops