unicode _ of _

Issue #82 resolved
Turgut Guneysu created an issue

Hi John

I have been using this command a while now and it never felt right in syntax and it does not match the structure used in other similar commands.

I propose the following change for your consideration:

  • unicode of item _ of _ : This matches the format of

OR

  • unicode of _ in _ starting at _ : This matches the format of

OR better yet

  • unicode of _ : This is the BEST format because UNICODE is a single character function. If any iteration through a string is required, the user can do that easily via loop constructs. Plus this block’s visual matches the format of the complementary reverse function.

Final side benefit is, it will work with string loaded LISTs as well, whereas the current format rejects a LIST dropped into the last white block.

Comments (3)

  1. John Maloney repo owner

    Your last suggestion makes logical sense but it wouldn’t be efficient for processing long strings since it requires allocating a single character string object for each character in the original string, then immediately converted into an integer. The current design doesn’t require an object allocation.

    “unicode of item _ of _” does describe what this reporter does, but it’s verbose. Given that this is an advanced block and that folks who are working at the level of Unicode characters are probably already familiar with the concepts, I think the current version is okay for now. Might re-evaluate later based on feedback from educators or students.

  2. Log in to comment