racket / racket/htdp

image composition functions (overlay, beside, above) inconsistent with arithmetic (+) in ISL

Open
#68 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement teachpack
Dominant language
Racket
Stars
112
Forks
73
Avg merge
9h 41m
Merged PRs (30d)
1

Description

In BSL, overlay, beside, above, act similar to + -- they act as different types of sums on images, and all are multi-arity with a minimum argument count of 2 (if you provide fewer than 2 arguments, they all error).

In ISL, + (and *) can be given one argument, in which case it acts as an identity, and zero arguments, in which case it returns an identity. This is really useful since ISL has apply, and this means you can (apply + some-list), without worrying about the case that some-list has one or zero elements.

It seems like the image library functions should act in the same way in ISL -- with one argument, they should act as an identity and with zero arguments, they should return an identity (an empty image). This would retain the consistency with +, which seems important. Obviously I can implement these functions in a few lines of my own code, but I don't want to have these little library shims that I have to explain to students to require & use!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the ISL implementations and tests for the image functions overlay, beside, and above, then compare their argument handling with + and *. Done means zero arguments return an empty identity image, one argument acts as an identity, and tests cover these cases.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.