Questa

From Esolang
Jump to navigation Jump to search

Questa(from "Queue and stack ") is an Esoteric data structure by User:ChuckEsoteric08, that is similar to the Deque, but you can push elements only on the top.

Operations

The Questa's abstract nature conditions a representation by its basic functionality.

Basic Operations

There are four basic operations in Questa:

Operation Function
PUSH Push element on top of the Questa
POP1 Pop element from top of the Questa
POP2 Pop element from bottom of the Questa
SWAP Swaps element from bottom with element from top

The Questa ADT

The Questa as an abstract data type (ADT) shall be specified in the following:

PUSH(x : any) : void — Pushes the element x to the top of the Questa and returns no value.

POP1() : any — Returns the Questa's top element. If the Questa is empty, an error will be signaled.

POP2() : any — Returns the Questa's bottom element. If the Questa is empty, an error will be signaled.

SWAP() : boolean — Exchanges the position of the Questa's top and bottom elements. If the Questa contains one or more items a Boolean value of true will be returned; for an empty Questa false is produced.

Questa-complete

Questa-based languages can be called "Questa-complete" if:

  • The data capacity is unbounded
  • All of the basic commands listed above are implemented

Questa-based languages

Two Questa-based languages are currently in existence:

Language Questa-completeness
Quests Yes
Miw No

Implementations

  • Common Lisp implementation of the Questa data structure. Please note that some assumptions have been introduced in order to rectify the lacunae.