laconic 2.0.0

Interpreter for Laconic expressions and scripts, both as a library component and command-line executable
Documentation
w(
	[sIterates through all days from October 15, 1582 up to dec 31, 2025]¶
	[sand checks if the sequence number is one more than the previous one.]¶
	¶
	[sIf, at the end the script outputs]¶
	[s		2026 13 32]¶
	[sthen all sequence numbers were correct.]¶
	¶
	[sOtherwise, the year, month and day of the first erroneous sequence number]¶
	[sare output.]¶
	¶
)

R
	#daysInMonth
	;;
		$#leap k
		$#m k
		?=v#m 2 
			?v#leap 29 28
			?<v#m 8
				?=%v#m 2 1
					31
					30
				?=%v#m 2 1
					30
					31

Z#quiet 1
o,#fmt 0 #. #
$#y 1582
$#prev 0
$#endYear 2026
Z#loops + o,#greg v#endYear 12 31

W
	<
		v#y
		v#endYear
	;(
		$
			#m
			?
				= v#y 1582
				10
				1

		W
			<
				v#m
				13
			;(
				$#d
					?
						& = v#y 1582 = v#m 10
						15
						1
				$
					#days
					X(
						#daysInMonth
						v#m
						o#leap v#y
					)

				W
					!>
						v#d
						v#days
					;(
						$#seq o,#greg v#y v#m v#d
						+:#prev 1

						[c
							w+(
								[sseq: ]
								v#seq
								[s prev: ]
								v#prev
							)
						]

						?
							!=
								v#seq
								v#prev
							;(
								w+(
									[sWrong sequence number for (YMD): ]
									v#y
									[s ]
									v#m
									[s ]
									v#d
								)

								$#y v#endYear
								$#m 13
								$#d 32
							)
							0
						+:#d 1
					)
				+:#m 1
			)
		+:#y 1
	)

w+(
	¶ [sFinal output:] ¶
	#
	v#y
	[s ]
	v#m
	[s ]
	v#d
	o#uni 10
)