usethesource / rascal

The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
http://www.rascal-mpl.org
Other
400 stars 77 forks source link

replace arbLoc, arbInt, arb... functions with generic `arb(type[&T])` #1507

Open jurgenvinju opened 3 years ago

jurgenvinju commented 3 years ago

Describe the bug

Logging this for the future.

There are arbX functions for all kinds of types but not for all. This is inconsistent and hard to document. Below the hood there is the generic functionality to generate values for types in IValueFactory, so let's just expose that in util::Arb with:

java &T arb(type[&T] \type);

We can later extend that module with generating random syntax trees as well (with code from DrAmbiguity).

DavyLandman commented 9 months ago

superseded by #1715

jurgenvinju commented 9 months ago

this is quite a different item than #1715; in fact, if we solve this issue and rename it to random(type[&T] t), then #1715 would not be needed.