<aeth>
Wait, HtDP doesn't have vectors in it? Then it just spreads the extremely misconception that Lisps are esoteric languages with strange data structures where you can't just port programs and algorithms from other languages. i.e. I don't think it's how you should design a program!
<aeth>
Sure, you still have to do an "idiomatic" pass after you port an algorithm or existing source to do things like remove unnecessary setting and rely more on return values, etc.
<aeth>
s/the extremely misconception/the extremely common misconception/
keep_learning has joined #racket
Fernando-Basso has quit [Read error: Connection reset by peer]
mzan has left #racket [#racket]
<jcowan>
Well, BSL does not. I have not looked at any later HtdP languages
<jcowan>
I can't think of any language, not even Cobol, that has structures but not vectors. (Cobol had structures before *anybody*.)
<jcowan>
But yes, I'd guess that it has to do with teaching recursive decomposition, which is not straightforward with Lispy vectors
<jcowan>
If slices were standard equipment, you could write vector-car and vector-cdr, but vector-cons would still involve copying.
vraid has quit [Ping timeout: 250 seconds]
<aeth>
jcowan: Well, I thought the way to handle vectors recursively is to pass indices, which I guess your vector-car and vector-cdr would be doing implicitly
<jcowan>
Just so. A slice is a triple (vector start-index end-index) inclusive and exclusive respectively
<aeth>
I really hope an introduction to recursive thinking does deal with this sort of thing.
<jcowan>
Well, it is more complex to deal with recursive data when you don't have recursive codata as well,.
<jcowan>
Another way to look at vectors is as lists whose car is mutable and cdr is immutable
<jcowan>
s/lists/lists of pairs
<jcowan>
I mean lists made of pairs in the usual way, of course
orivej has joined #racket
pera has quit [Ping timeout: 268 seconds]
lockywolf has joined #racket
selimcan has joined #racket
ng0 has quit [Quit: Alexa, when is the end of world?]
orivej has quit [Ping timeout: 268 seconds]
ZombieChicken has quit [Ping timeout: 256 seconds]
ZombieChicken has joined #racket
dbmikus_ has joined #racket
dbmikus_ has quit [Ping timeout: 268 seconds]
<aeth>
Can a pair be seen as a vector of length two? Because then you can apply your definition recursively and '(x . y) can be seen as #(x y) which can be seen as '(x y) which is '(x . (y . ()))
<aeth>
And then, of course, no reason to stop there.
<jcowan>
aeth: Well, yes, but then you lose the O(1) nature of access to vector locations, which is the whole point of vectors.
g00s has joined #racket
dddddd has quit [Remote host closed the connection]
selimcan has quit [Quit: Leaving]
rnmhdn has joined #racket
ubLIX has quit [Quit: ubLIX]
`micro has quit [Ping timeout: 246 seconds]
`micro has joined #racket
lockywolf_ has joined #racket
lockywolf has quit [Ping timeout: 268 seconds]
orivej has joined #racket
rnmhdn has quit [Ping timeout: 246 seconds]
lockywolf_ has quit [Ping timeout: 268 seconds]
gour has joined #racket
Lowl3v3l has joined #racket
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
lockywolf has joined #racket
jao has quit [Ping timeout: 250 seconds]
gour_ has joined #racket
rnmhdn has joined #racket
gour has quit [Ping timeout: 250 seconds]
mzan has joined #racket
jcowan has quit [Quit: Connection closed for inactivity]
sauvin has joined #racket
buyfn has joined #racket
rnmhdn has quit [Ping timeout: 268 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #racket
buyfn has quit [Quit: buyfn]
rnmhdn has joined #racket
lockywolf has quit [Remote host closed the connection]
<dzoe>
But I can't see how the ffi-definer in private/ffi.rkt produces a different signature than the contract in main.rkt :-/
ng0 has quit [Quit: Alexa, when is the end of world?]
jao has joined #racket
dbmikus__ has quit [Ping timeout: 240 seconds]
baldfat has joined #racket
dbmikus__ has joined #racket
ziyourenxiang has quit [Ping timeout: 268 seconds]
ZombieChicken has joined #racket
jcowan has joined #racket
pierpal has quit [Quit: Poof]
pierpal has joined #racket
hjek has quit [Quit: Leaving.]
jzyamateur has joined #racket
<jzyamateur>
Hello all, racket beginner here, Was wondering if racket module system has any kind of namespacing when using require?
<jzyamateur>
E.g. requiring module will affect current bindings in the file right (pollute existing namespace)? Correct me if I wrong or point to a well known best practice..
<lexi-lambda>
jzyamateur: Sure, by default, requiring a module will dump all of that module’s provided identifiers into the current module’s scope. But keep in mind: (1) every module has its own scope, there is no global namespace, (2) namespace conflicts are detected at compile-time, and (3) you can opt-in to finer namespace control by using only-in, rename-in, and/or prefix-in.
<jzyamateur>
I am using drRacket but I guess linters do show conflicts at compile tiem, I'll check more about only-in, rename-in etc. Thank you
<lexi-lambda>
jzyamateur: There are no Racket “linters” that I know of; an import conflict will make the code fail to compile.
<lexi-lambda>
jzyamateur: You are right that Racket allows you to shadow module-imported definitions, but if you import two different modules that both export the same name, you will get a compile-time error.
<jzyamateur>
Ah ok. Got it.
hjek has joined #racket
ym has quit [Remote host closed the connection]
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
peddie has quit [Remote host closed the connection]
clacke[m] has quit [Remote host closed the connection]
jzyamateur has quit [Quit: Page closed]
bug2000 has quit [Remote host closed the connection]
clacke[m] has joined #racket
peddie has joined #racket
sauvin has quit [Read error: Connection reset by peer]
hjek has quit [Quit: Leaving.]
rnmhdn has quit [Ping timeout: 250 seconds]
ZombieChicken has quit [Ping timeout: 256 seconds]
libertyprime has quit [Ping timeout: 268 seconds]
libertyprime has joined #racket
g00s has joined #racket
pera has quit [Ping timeout: 268 seconds]
clacke[m] has quit [Read error: Connection reset by peer]
peddie has quit [Write error: Connection reset by peer]
clacke[m] has joined #racket
peddie has joined #racket
pera has joined #racket
confusedwanderer has quit [Remote host closed the connection]
Fernando-Basso has joined #racket
mzan has left #racket [#racket]
orivej has quit [Ping timeout: 250 seconds]
dbmikus__ has quit [Ping timeout: 250 seconds]
dbmikus has joined #racket
dan_f has joined #racket
pie__ has joined #racket
ZombieChicken has joined #racket
Fernando-Basso has quit [Remote host closed the connection]
ubLIX has joined #racket
icantc has joined #racket
pie_ has joined #racket
pie__ has quit [Remote host closed the connection]