-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
A sample homework:
Hey does anyone know how I can add an element to the end of a list in scala WITHOUT using :+?
I'm working on this recursion problem for my homework and the instruction is that I can only use List.empty, .isEmpty, .nonEmpty, .:: (cons), .head, .tail
It would be nice if a student could scalac --profile:homework1 which would surface only the allowed API on the classpath. This would work similarly to --release. The trick might be how to make it easy to specify and generate the permitted API as a ct.sym file.
IRL projects could use such a facility to restrict API usage. In particular, it would not only restrict to a platform version like -release, but disallow methods deemed substandard for any reason.
Metadata
Metadata
Assignees
Labels
No labels