samth changed the topic of #racket to: Racket v7.6 has been released: https://blog.racket-lang.org/2020/02/racket-v7-6.html -- Racket -- https://racket-lang.org -- https://pkgs.racket-lang.org -- Paste at http://pasterack.org
technomancy has left #racket ["ERC (IRC client for Emacs 26.1.50)"]
iyzsong has joined #racket
<x6c697370> srandon111: you can use racket/draw's `bitmap%`, like `(call-with-input-file "my-image.png" (lambda (in) (make-object bitmap% in)))
<srandon111> x6c697370, all this mess?
<srandon111> shouldn't images be basic primary types in racket?
<x6c697370> not exactly sure what you mean by "basic primary types". Though the example I provided was needlessly verbose; it turns out that one of the `bitmap%` constructors allows you to use a path string instead of an input port, so `(make-object bitmap% "my-image.png")` is sufficient.
orivej has quit [Read error: Connection reset by peer]
orivej has joined #racket
Codaraxis has quit [Read error: Connection reset by peer]
badkins has quit [Remote host closed the connection]
badkins has joined #racket
nullcone has joined #racket
badkins has quit [Ping timeout: 265 seconds]
pilne has quit [Quit: REALITY.SYS Corrupted: Re-boot universe? (Y/N/Q)]
FreeFull has quit []
lockywolf_ has quit [Remote host closed the connection]
lockywolf_ has joined #racket
FreeFull has joined #racket
lockywolf_ has quit [Max SendQ exceeded]
lockywolf_ has joined #racket
lockywolf_ has quit [Max SendQ exceeded]
lockywolf_ has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 256 seconds]
lockywolf_ has quit [Ping timeout: 264 seconds]
hoplaahei has quit [Ping timeout: 256 seconds]
badkins has joined #racket
badkins has quit [Remote host closed the connection]
badkins has joined #racket
badkins has quit [Ping timeout: 256 seconds]
YuGiOhJCJ has joined #racket
nullcone has quit [Quit: Connection closed for inactivity]
sauvin has joined #racket
lockywolf has joined #racket
narimiran has joined #racket
dddddd has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 250 seconds]
tilpner has quit [Quit: tilpner]
nullcone has joined #racket
lockywolf has quit [Remote host closed the connection]
lockywolf has joined #racket
tilpner has joined #racket
x6c697370 has quit [Ping timeout: 246 seconds]
narimiran has quit [Ping timeout: 265 seconds]
jellie has joined #racket
lockywolf_ has joined #racket
jellie has quit [Ping timeout: 256 seconds]
lockywolf has quit [Ping timeout: 256 seconds]
jellie has joined #racket
jellie has quit [Ping timeout: 250 seconds]
jellie has joined #racket
jellie has quit [Ping timeout: 250 seconds]
jellie has joined #racket
jellie has quit [Ping timeout: 250 seconds]
jellie has joined #racket
jellie has quit [Ping timeout: 240 seconds]
jellie has joined #racket
wingsorc has joined #racket
narimiran has joined #racket
lockywolf_ has quit [Remote host closed the connection]
lockywolf has joined #racket
jellie has quit [Ping timeout: 264 seconds]
jellie has joined #racket
jellie has quit [Ping timeout: 256 seconds]
sagax has quit [Read error: Connection reset by peer]
sagax has joined #racket
jellie has joined #racket
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
lockywolf_ has joined #racket
lockywolf has quit [Ping timeout: 256 seconds]
jellie has quit [Read error: Connection reset by peer]
jellie has joined #racket
catonano has joined #racket
lockywolf__ has joined #racket
lockywolf__ has quit [Max SendQ exceeded]
lockywolf__ has joined #racket
lockywolf_ has quit [Ping timeout: 258 seconds]
catonano has quit [Quit: catonano]
catonano has joined #racket
jellie has quit [Ping timeout: 258 seconds]
lockywolf_ has joined #racket
lockywolf_ has quit [Remote host closed the connection]
lockywolf__ has quit [Ping timeout: 265 seconds]
lockywolf_ has joined #racket
lockywolf_ has quit [Remote host closed the connection]
lockywolf_ has joined #racket
lockywolf_ has quit [Max SendQ exceeded]
lockywolf_ has joined #racket
jellie has joined #racket
lockywolf_ has quit [Remote host closed the connection]
lockywolf_ has joined #racket
lockywolf_ has quit [Remote host closed the connection]
lockywolf_ has joined #racket
lockywolf_ has quit [Max SendQ exceeded]
lockywolf_ has joined #racket
jellie has quit [Ping timeout: 258 seconds]
lockywolf_ has quit [Remote host closed the connection]
lockywolf_ has joined #racket
lockywolf_ has quit [Remote host closed the connection]
lockywolf_ has joined #racket
lockywolf_ has quit [Max SendQ exceeded]
lockywolf has joined #racket
lockywolf has quit [Remote host closed the connection]
lockywolf has joined #racket
lockywolf has quit [Remote host closed the connection]
lockywolf has joined #racket
lockywolf has quit [Remote host closed the connection]
orivej has joined #racket
iyzsong has quit [Ping timeout: 240 seconds]
jellie has joined #racket
rubic88 has quit [Ping timeout: 240 seconds]
<srandon111> guys do you use macros often?
rubic88 has joined #racket
badkins has joined #racket
dddddd has joined #racket
cpup has quit [Read error: Connection reset by peer]
cpup has joined #racket
true-grue has joined #racket
catonano has quit [Read error: Connection reset by peer]
catonano has joined #racket
<jcowan> srandon111: Only when there is a great deal of leverage from them. Modifying the syntax of your language is an excellent tool, but it is sharp and can cut you.
<jcowan> Syntax-rules is safe, but even so, unless used tastefully it decreases readability.
<jcowan> (these are my personal views)
rubic88 has quit [Read error: Connection reset by peer]
rubic88 has joined #racket
catonano has quit [Read error: Connection reset by peer]
catonano has joined #racket
urbanslug has joined #racket
jellie has quit [Ping timeout: 256 seconds]
urbanslug has quit [Ping timeout: 264 seconds]
urbanslug has joined #racket
urbanslug has quit [Ping timeout: 265 seconds]
MustardCheese has joined #racket
urbanslug has joined #racket
badkins has quit [Remote host closed the connection]
urbanslug has quit [Ping timeout: 264 seconds]
urbanslug has joined #racket
MustardCheese has quit [Remote host closed the connection]
MustardCheese has joined #racket
<srandon111> do you guys use drracket as editor for racket?
MustardCheese has left #racket ["Parted"]
MustardCheese|2 has joined #racket
ermo has quit [Ping timeout: 264 seconds]
urbanslug has quit [Ping timeout: 256 seconds]
ermo has joined #racket
<srandon111> guys i wasa reading how to design programs... and i wanted to understand what it means to design data and functions in an orthogonal way so that they are independent can you make me an example of when these are not orthogonal and hence not independent?
urbanslug has joined #racket
badkins has joined #racket
catonano has quit [Quit: catonano]
catonano has joined #racket
catonano has quit [Quit: catonano]
catonano has joined #racket
MustardCheese|2 has quit [Ping timeout: 256 seconds]
MustardCheese|2 has joined #racket
MustardCheese has joined #racket
MustardCheese|2 has left #racket [#racket]
catonano has quit [Quit: catonano]
catonano has joined #racket
ayerhart has quit [Quit: ayerhart]
ayerhart has joined #racket
ayerhart has quit [Client Quit]
ayerhart has joined #racket
catonano has quit [Quit: catonano]
urbanslug has quit [Ping timeout: 264 seconds]
urbanslug has joined #racket
badkins has quit [Remote host closed the connection]
badkins has joined #racket
urbanslug has quit [Ping timeout: 256 seconds]
badkins has quit [Ping timeout: 240 seconds]
MustardCheese has quit [Ping timeout: 258 seconds]
badkins has joined #racket
acarrico has quit [Quit: Leaving.]
efm has quit [Ping timeout: 256 seconds]
efm has joined #racket
MustardCheese has joined #racket
<samth> srandon111: note that jcowan isn't a Racket user -- in Racket they're used quite commonly and `syntax-rules` is not usually used.
badkins has quit [Remote host closed the connection]
badkins has joined #racket
badkins has quit [Ping timeout: 256 seconds]
badkins has joined #racket
badkins has quit [Remote host closed the connection]
<nisstyre> srandon111: I do use it, personally, even though I use vim for everything else mostly
pilne has joined #racket
MustardCheese has quit [Read error: Connection reset by peer]
<jcowan> Yes, in some ways Racket /= Scheme.
<samth> well, Racket is a Scheme, but you mostly hang out in different subsets because you have different goals/preferences than the Racket community
<jcowan> What's the most common way to construct simple macros?
<samth> jcowan: usually I'd use `define-syntax-rule` or `define-simple-macro` if that works, otherwise I'd use `define-synax` with `syntax-parse`
<samth> I should use `define-simple-macro` more, but since I wrote `define-syntax-rule` long ago it's my muscle memory go-to
<jcowan> That looks like a trivial version of syntax-rules
<jcowan> My limited experience with s-r is that I want at least two rules, often more
<samth> if you want two rules, you want a procedural macro
<jcowan> samth: why would you want a more complex procedural macro for a simple base-recursive case?
<samth> jcowan: the introduction to Culpepper and Felleisen 2010, Fortifying Macros, gives a good example
davidl has quit [Ping timeout: 256 seconds]
narimiran has quit [Ping timeout: 264 seconds]
davidl_ has joined #racket
<srandon111> samth, why if globals are generally discouraged in racket they seem to be encouraged?
<srandon111> i mean doesn't that make functions lesss re-usable ?
<samth> srandon111: i'm not sure what you mean. where are they encouraged?
<srandon111> look at this short video
<srandon111> that guys wants to add a Speed constant to an animation
<srandon111> he is using racket
<srandon111> look how the function used to change the position of the cat is passed a single parameter and then uses the speed
<srandon111> constant
<samth> srandon111: if there's a constant value used somewhere in your program, defining a constant for that is good practice. that's not what people usually mean by discouraging global variables.
<samth> srandon111: people are discouraging mutable global variables, which are something different (and which HTDP does not use)
<srandon111> samth, what are mutable global variables then?
<srandon111> i can't understand when to use them or when not
<srandon111> samth, ok but that function now will always depend from an external value called SPEED
<srandon111> and cannot be reused in another code base right?
<srandon111> samth?
<samth> srandon111: if you have a number that appears somewhere in your code that is special, you should probably define a constant and give it a name
<srandon111> samth, ok but the function becomes non reusable right?
<samth> in general, to re use code you'll have to use all of the things it depends on
<srandon111> ok so basically i should put the function and the constnt in a file and use them as a module?
davidl has joined #racket
badkins has joined #racket
davidl_ has quit [Ping timeout: 250 seconds]
badkins has quit [Ping timeout: 260 seconds]
<samth> yes
<srandon111> he defines a struct representing the position of the cow
<srandon111> but then for the images he defines two global constants?
<srandon111> i mean wouldn't make more sense if also the images would belong to the cow structure?
<samth> you can have different positions for the cow at different times
<samth> but the images are always the same
<srandon111> if i have a lot of sprites for many images should i have a bunch of constants for each image???
<srandon111> samth,
selimcan has joined #racket