-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented setcursor
#46
base: main
Are you sure you want to change the base?
Conversation
Not to sure how to write a unit test for this. Also not sure if the assumption that a passed in vector is just a two element-primitive list is the correct one.
This is an interesting approach. It looks like ucblogo at least uses setcursor to position the text cursor as if it's in a text mode terminal with [ 0 0 ] in the top left corner. So:
... leaves the upper left of the terminal as:
overwriting whatever was there previously. I'm hesitant to spawn new text overlays on every call. As it stands, I'm not sure what the benefit of this PR's IMHO, the "right" approach to match UCBLogo would be to implement a virtual terminal. That's not trivial; https://github.com/inexorabletash/jsbasic/blob/master/tty.js could be of some inspiration, but it's pretty Apple II-specific. Here at least it could use a |
I'm not sure if you mean "interesting" in a polite way or you really think that my approach is really interesting. 😆 I recognize that communicating via Github (like most online communication) can be difficult, especially between strangers. If you were being polite, I appreciate that but I've got pretty thick skin. Feel free to critique in a straightforward manner. 😄 Ugh. Accidentally hit 'comment'. More below. I would characterize the solution as 'simple' and 'straightforward'. My goal was just to mimic the behavior that I saw, from a user's POV, in UCBLogo, not necessarily ape the implementation. I agree with you though that this solution lacks elegance and is not scalable (i.e. what would happen if we had hundreds of thousands of
• Is it better to have no implementation or a simple/straightforward implementation that works now and can easily be refactored later? In my 'real job' I'm a product manager for a software component. There are pros and cons to this, but personally and professionally speaking I have been leaving the "it needs to be right the first time" camp for the "if it works now we can iterate and develop later". So, it's fine if you don't take this pull request 😄 I sense that you're leaning that way and I'm totally ok with it (and I SHOULD be totally ok with that). [DANG IT. I hit 'update' too early again.] Just to let you know, I'm going through Brian Harvey's companion book to learning Logo and I'm implementing things that aren't implemented. |
Feel free to close this pull-request. I'll submit a PR from time to time. I do appreciate the feedback given. |
Ha! Well, a bit of the polite version, but honestly interesting in the "I hadn't thought of it that way at all..." sort of way. I do want to understand the use case - i.e. what can you do with this that you can't do with
Good question. So far it's been a hobby for me and feedback from a handful of teachers and parents using it. So development priorities:
Together those eschew anything that adds too much complexity. One thing that I'm handling in another set of PRs is localization so non-English users can be supported more easily.
Absolutely! But of course since so far it's been mostly just me there isn't an active community or articulated vision - just what's in my head. At this point I'd suggest the best approach is to file a feature request issue with an offer to maybe do the work and ask for guidance or suggest an approach.
As noted, I'm likely to say "no" to anything that adds unwarranted complexity since it makes future changes more difficult. But complexity can be in the eye of the beholder.
Best to ask first. Of course, it depends on how much you like iteration and how much time you have. It's acceptable to have a discussion by starting off with a fleshed out PR if you don't mind being told "nope, let's take a different approach". That's a fairly common in my day job, but I don't want to scare off hobbyist contributors here.
Throwing industry jargon back at you: depends on the amount of technical debt!
Again, let's figure out if this
Noted. And of course this is now ~10 year old code mostly belted out in a day or two that's been prodded at in spare moments, and I know far more about the Web platform, JS and Logo itself than I did when I started, so the code may not actually reflect my vision. I'd write a lot of it differently now, e.g. having everything being an implicit closure over the interpreter instance means breaking out the library into a separate file will be a lot of work, etc. In lieu of that, easy guidance: if the change is a single library function that's a no-brainer. If it requires intrusive changes to other code start with an issue/discussion if it doesn't seem obvious. But I definitely welcome help in plugging the gaps! |
I'm hoping to use this in a Chinese teaching environment (I live in China). I like Brian Harvey's written curriculum; it is VERY dated but the beautiful thing is that all of the content is relevant even though most of the cultural references aren't. 😆
I'm not going to pretend that One reason to implement In this case, I think the technical debt is very minimal. My solution is NOT complex and it would be easy to rip it out in favor of a more sophisticated (i.e. complex and complete haha) solution. Another reason to want to port UCBLogo completely is that all the documentation and specification is there already. Someone could just pick up the UCBLogo spec (circa 1997) and not worry about figuring out how to use a workaround (e.g. "Use From a pedagogical position, I like NOT having to rewrite curriculum. I'm trying to see if I can just use Brian Harvey's curriculum in Chinese (translated by me); I would love to not have to rewrite his examples and exercises. Thus my own personal desire to see
I am a poor man's computer scientist/programmer. I enjoy teaching (I teach software development at a vocational school in a rural part of China) and I do enjoy programming but I'm more gifted in management and product development. A nice way of saying this is that I'm a big idea person that can help manage people and projects with great communication skills. A crude way of describing this is that I am good at bossing people around. That said, I'd be happy to help you formulate some of your own vision for In any case, I think the spirit of Github is that I should feel free to make my own changes in my own repo as I see fit and you would accept submitted PRs as you see fit. Ideally, though, it would be nice if both repos would benefit from mutual development; it would be a pain if the delta between two codebases became so great that it made no sense to share code. Right now, I'm in the frame of mind that I want my repo to be as close to yours as possible for this reason. |
setcursor
allows you set a vector from which Logo will begin outputting from while preserving previous text outputs. This implementation clones new nodes based upon#overlay
and renders them within the confines of the display context (i.e.<canvas>
). The behavior ofcleartext
has been modified to account for this new rendering behavior.Not to sure how to write a unit test for this. Also not sure if the assumption that a passed in vector is just a two element-primitive list is the correct one.