PLDB
Languages Features Creators Calendar CSV Resources Blog About Donate Add Language
GitHub icon

Assert Statements

< >
Example from Java, Pizza, Deesel:
// By default, assertions are disabled // java 鈥揺nableassertions Test int score = 10; assert score >= 10 : " Below"; System.out.println("score is "+score);
#include <assert.h> int i, a[10]; for (i = 0; i < 10; ++i) { assert(0 <= i && i < 10); a[i] = 10-i; } for (i = 0; i < 10; ++i) { assert(0 <= i && i < 10); assert(0 <= a[i] && a[i] < 10); a[a[i]] = a[i]; }
Example from C3:
assert(a > 0, "Expected a positive number"); $assert(Foo.sizeof == 8, "Foo sizecheck at compile time failed");
Example from Jule:
use std::debug use std::debug::assert::{assert} fn main() { std::debug::ENABLE = true let x = 200 assert(x < 200) }

Languages with Assert Statements include Java, C, C++, Objective-C, C3, Jule, Pizza, Deesel, Tick C, cooC, Real-Time Concurrent C

Languages without Assert Statements include progsbase

Read more about Assert Statements on the web: 1.

HTML of this page generated by Features.ts

hasArraySlicingSyntax.html 路 hasAssertStatements.html 路 hasAssignment.html

View source

PLDB - Build the next great programming language Search v2023 Day 157 Docs Acknowledgements Traffic Today Traffic Trends Mirrors GitHub feedback@pldb.com