We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Semi-Order

From Esolang
Jump to navigation Jump to search
Not to be confused with Wikipedia:Semiorder.

A Semi-Order is a data type based on lists and sets, specifically, acting as a midpoint between them.

Description

There are two descriptions. One is more "formal" while the other is in plain language.

Formal

[ ... , x , ... , y ] ≠ [ ... , y , ... , x ]
[ ... , x channel_n , ... , y channel_n ] = [ ... , y channel_n , ... , x channel_n ]
[ ... , x channel_n , ... , y channel_m ] ≠ [ ... , x channel_m , ... , y channel_n ] ≠ [ ... , y channel_n , ... , x channel_m ]

where [ and ] are the starts and ends of the Semi-Order respectively, and , is the separator of elements. The elements x and y are elements of the order, and the channel's are single integers. The syntax is not absolute though, this was just for demonstration.

Plain

A Semi-Order is an ordered list of elements, and any of these elements may or may not have a channel number. In the case of two or more elements having the SAME channel number, they can be freely swapped while preserving equality. However, in the case their channel numbers are unequal or they do not have a channel number attached, swapping them will break equality.

Languages that use Semi-Orders