KLIC

1 program Added 2026-03-17T05:56:28Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: KL1
Provenance: commit e21c367de7 · authored 2026-03-17T06:57:00+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

5 sources · pl_id: pl/kl1
LLM (this repo) · 1PldbWikipediaRosettacodeWikidata · Q5965507

Related languages

kBasic (0.20)KL1 (0.19)Klara (0.14)Klein (0.14)Klong (0.14)

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Programs collected by LLM agents experimental · unverified

Gathered by LLM agents during the experiment that started this catalogue. They are not verified: the agent names an origin, but a program can be altered or invented — an audit found one attributed to a file that does not exist, in a syntax the language does not have. Prefer the programs archived by Software Heritage above. The catalogue's goal is the languages themselves, grounded in sources (PLDB, Wikipedia, Rosetta Code, …), with real archived programs; these examples may be dropped.

Queue Data Structure

Provenance: commit e21c367de7 · authored 2026-03-17T06:57:00+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.kl1 · license: ICOT Free Software License · added: 2026-03-17T05:56:28Z
/* ---------------------------------------------------------- 
%   (C)1993,1994,1995 Institute for New Generation Computer Technology 
%       (Read COPYRIGHT for detailed information.) 
%   (C)1996, 1997, 1998, 1999 Japan Information Processing Development Center
%       (Read COPYRIGHT-JIPDEC for detailed information.)
----------------------------------------------------------- */
:- module queue.


create(Stream) :-
	CAR = CDR,
	main(Stream,[],0)+CAR+CDR.


main([],		 []		)+No+CAR+CDR :- CDR = [].
main([],		 [S|ST]	)+No+CAR+CDR :- main(S,ST)+No+CAR+CDR.
main([do(S)|T],	 ST		)+No+CAR+CDR :- main(S,[T|ST])+No+CAR+CDR.
otherwise.
main([Message|T],ST		)+No+CAR+CDR :-
	message(Message)-No-CAR-CDR,
	main(T,ST)+No+CAR+CDR.


message(empty(YorN))-No-CAR-CDR :-
	No =:= 0 |
	YorN = yes.
message(empty(YorN))-No-CAR-CDR :-
	No =\= 0 |
	YorN = no.

message(put(Value),No1,No2)-CAR-CDR :-
	No2 := No1 + 1,
	dlist(Value)-CDR.

message(get(Value),No1,No2)-CAR-CDR :-
	No1 > 0 |
	No2 := No1 -1,
	dlist(Value)-CAR.

message(get_if_any(Value),No1,No2)-CAR-CDR :-
	No1 =:= 0 |
	No2 = No1,
	Value = {}.
message(get_if_any(Value1),No1,No2)-CAR-CDR :-
	No1 =\= 0 |
	message(get(Value2),No1,No2)-CAR-CDR,
	Value1 = {Value2}.

message(get_all(Values),No1,No2,CAR1,CAR2)-CDR :-
	No2 = 0,
	get_all(No1,CAR1,CAR2,Values).

message(carbon_copy(Values))-No-CAR-CDR :-
	get_all(No,CAR,_,Values).


dlist(V,LIST,CDR) :-
	LIST = [V|CDR].


get_all(No,CAR,TAIL,V):-
	No =:= 0 |
	CAR	= TAIL,
	V	= [].
get_all(No,[CAR|CDR],TAIL,V1):-
	No =\= 0 |
	V1 = [CAR|V2],
	get_all(~(No-1),CDR,TAIL,V2).

Contribute — propose a file extension

Tell us where to find evidence about KLIC (mapped to pl/kl1). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/KLIC/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← klerer-may-system KlingonCode →