Closed pmaddams closed 5 years ago
Hi @pmaddams
There is a new implementation of the sicp picture language available:
https://github.com/sicp-lang/sicp/tree/master/sicp-pict2
Download the rkt-file and the image and save them in the same folder.
Open the rkt-file in DrRacket and run it.
The einstein painter is available as einstein
.
Skim though the rkt-file to see the available. For one there are other colors than black and white. Also images are larger.
/Jens Axel
Thanks. I already had this package installed on my system from running raco pkg install sicp
. To use it, I renamed the file to "main.rkt."
I think there are two reasonable paths forward:
(#%require sicp-pict2)
. Fix the bug in the older package and retain it for backwards compatibility.(#%require sicp-pict)
uses the new implementation. For backwards compatibility, provide the old interfaces as wrappers around the new ones. For example, (define load-painter bitmap->painter)
.Do you have another solution in mind?
Additional comments:
escher
example is not made available with provide
.Thanks for your work.
I think 2. is the way to go. Maybe even expect people to use
#lang racket
(require sicp-pict)
The old code was ported from the original mit-scheme (very old) and was made to run with as few changes as possible. Finding bugs in that code is not fun.
Would you be interested in making the changes? And perhaps find a bigger, higher resolution image?
I might be interested in making the necessary changes. However, my previous pull requests were not accepted. I do not want to put the time into understanding and modifying the software, only to eventually find out you want to do it your own way and ignore those changes.
With that in mind, I think it is best if you continue to maintain the software according to your own expectations.
Hi,
Just checked and found the random and docs pull request. Something must have gone wrong. I was sure I clicked commit+close. I see now that they weren't committed. I'll take a look again.
/Jens Axel
2017-08-10 22:33 GMT+02:00 Pavan Maddamsetti notifications@github.com:
I might be interested in making the necessary changes. However, my previous pull requests were not accepted. I do not want to put the time into understanding and modifying the software, only to eventually find out you want to do it your own way and ignore those changes.
With that in mind, I think it is best if you continue to maintain the software according to your own expectations.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sicp-lang/sicp/issues/14#issuecomment-321665428, or mute the thread https://github.com/notifications/unsubscribe-auth/AAcLxTf3dEvhp_D-hEO_NuI4ZBbD2Cylks5sW2kYgaJpZM4OzcGG .
-- -- Jens Axel Søgaard
It seems I have hit the wrong button. I can't fix though - Github won't let me reopen the pull request because your repository was deleted.
/Jens Axel
Hi @pmaddams, I'm sorry that the technical difficulties prevented you from contributing to the repo. In any case, since our current random
function is based on yours, I added you as a contributor here.
Regarding the vector-ref: contract violation for transforming images of certain sizes
error, because we now use the new sicp-pict
collection, I believe the bug is fixed, so I will close this issue. Please feel free to reopen the issue if that's not the case.
Hi Jens,
The following code works as expected until the last line.
At this point it throws the error:
The image in question is this one: wave.
Only some transformations cause errors. These include
flip-vert
,rotate90
, androtate180
. Others such asflip-horiz
androtate270
did not fail.But if you increase the height of the image by one pixel, that is, change the size from 182x182 to 182x183, all of these transformations work as expected.
Based on this information, I tried several other things.
I encourage you to try using the image in question, which is part of the online SICP book, and see for yourself if you get the same error.