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
Even if I run slideshow
from the terminal it still spawns a not-fullscreen window that’s cut off at the top
@jarcane Did you use slideshow -M0
or slideshow -M1
to choose your screen?
A bit confusing --fullscreen
means 4:3 and --widescreen
means 16:9
Well, I tried first running from DrRacket, and it always picks the opposite screen
I didn’t know about those options for my commandline attempt
I’ve wound up just using Spectacle and the Cmd+Opt+F to fullscreen the window that way
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.
But using Spectacle seems practical.
Why did Apple remove all non-Thunderbolt 3 ports? :thinking_face: http://snip.ly/u52g4r
because aside from backward compatiblity there’s little need for anything else
once upon a time people made all the same grumbles about USB
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)))))
(apply fnc (list itm1 itm2)) is the same as (fnc itm1 itm2)
I like naming lists xs (a list of xes) and then letting x be name of an element of the list xs.
(define (some f xs ys)
(for/or ([x xs])
(for/or ([y ys])
(f x y))))
@soegaard2 Nice one thanks.
using for*/or would be slightly simpler
It doesn’t do the same as the common lisp version though.
@laurent.orseau Good call, looks nicer.
I think this one works: (define (some f xs ys)
(for/or ([x xs] [y ys])
(f x y))
And that’s the same as or-map ?
That’s different from the code above, isn’t it?
ormap !
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
@soegaard2 I’ll check that out, I’m looking at the common lisp hyperspec for the definition.
In Common Lisp (some #'= '(1 2) '(2 1))
will be false. But in your initial version (I think) it will return true.
@soegaard2 Yes it is possible I’ve misunderstood the functionality.
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.’
And it gives an example (some #'= '(1 2 3 4 5) '(5 4 3 2 1)) => true
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))
In that example the two 3’s have the same index.
It computes (or (f x0 x1) (f x1 y1) (f x2 y2) …)
So there is no nesting.
Corrected the example - wrote the same thing twice.
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?
yes
Ok
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.
yes
Ok, cool, I get it now.
CL some
is Racket ormap
and CL every
is Racket andmap
.
That would make life easier, thanks.
everything else is Racket for*/fold
:stuck_out_tongue:
Is that a challenge?
Hehe
Laurent is right. I think even unfold
is a for/fold ?!?
Grammar question: Is color-and-stops
or colors-and-stops
the better choice?
I thought that stylistically, +
is preferable over -and-
which is also interesting now that I think about it. &
would be more accurate
Is s
distributive? What about <color-and-stop>s
?
Maybe color-stops
is better?
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 has joined the channel
+1 for color-stops