Category:Wren-check: Difference between revisions

From Rosetta Code
Content added Content deleted
(Change to blurb following addition of Benchmark class.)
m (Now using internal links to related pages.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{library}}
{{library}}
'''Wren-check''' is a module which enables one to check that a Wren value (usually a method or function argument) is of a given type or types and, where possible, within a given range of values. It can also check whether a more general condition is met and report on the time taken to run a piece of code. It consists of a two classes, Check and Benchmark, whose methods are all static.
'''Wren-check''' is a module which enables one to check that a Wren value (usually a method or function argument) is of a given type or types and, where possible, within a given range of values. It can also check whether a more general condition is met, check that integer arithmetic is 'safe' (within the ± 2^53 limit) and report on the time taken to run a piece of code. It consists of four classes: Check, SafeInt, SafeInts and Benchmark, whose methods are all static.


It is the twenty-seventh in a series of modules (listed on the language's [https://rosettacode.org/wiki/Category:Wren main page]) designed to assist with writing Rosetta Code tasks so the same code does not have to be written or copy/pasted time and time again thereby bloating a task's script code unnecessarily.
It is the twenty-seventh in a series of modules (listed on the language's [[:Category:Wren|main page]]) designed to assist with writing Rosetta Code tasks so the same code does not have to be written or copy/pasted time and time again thereby bloating a task's script code unnecessarily.


To use it you have to copy the source code (in the [https://rosettacode.org/wiki/Category_talk:Wren-check talk page]) to a text file called ''check.wren'' and place this in the same directory as the importing script so the command line interpreter can find it.
To use it you have to copy the source code (in the [[:Category_talk:Wren-check|talk page]]) to a text file called ''check.wren'' and place this in the same directory as the importing script so the command line interpreter can find it.

Latest revision as of 15:21, 9 May 2023

Library
This is an example of a library. You may see a list of other libraries used on Rosetta Code at Category:Solutions by Library.

Wren-check is a module which enables one to check that a Wren value (usually a method or function argument) is of a given type or types and, where possible, within a given range of values. It can also check whether a more general condition is met, check that integer arithmetic is 'safe' (within the ± 2^53 limit) and report on the time taken to run a piece of code. It consists of four classes: Check, SafeInt, SafeInts and Benchmark, whose methods are all static.

It is the twenty-seventh in a series of modules (listed on the language's main page) designed to assist with writing Rosetta Code tasks so the same code does not have to be written or copy/pasted time and time again thereby bloating a task's script code unnecessarily.

To use it you have to copy the source code (in the talk page) to a text file called check.wren and place this in the same directory as the importing script so the command line interpreter can find it.

Pages in category "Wren-check"

The following 4 pages are in this category, out of 4 total.