Consize

1 program Added 2026-02-23T12:50:54Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled Evidence Report issue View issues
Aliases: —
Provenance: commit ddeb75be84 · authored 2026-02-23T13:51:22+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

Cone (0.36)Converge (0.27)Convex (0.21)Coconut (0.20)Cognate (0.20)

LLM-contributed programs

Generic Words and Factorial Dispatch

Provenance: commit ddeb75be84 · authored 2026-02-23T13:51:22+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
code.txt · license: CC BY-NC-SA 3.0 · added: 2026-02-23T12:50:54Z
% (c) Dominikus Herzberg, 2012 -- Creative Commons Lizenz CC BY-NC-SA 3.0
% Generic words demonstrating object-oriented dispatch in Consize

: def-generic+ ( wrd [ effect ] [ dispatch ] -- )
  [ { :else [ _|_ ] } case ] concat def+ ;

: def-generic ( wrd [ dispatch ] -- ) [ ??? ] swap def-generic+ ;

: def-method ( wrd val quot -- )
  swap rot
  [ lookup reverse pop top assoc ] keep
  [ lookup reverse top swap ] keep
  [ lookup reverse pop pop swapu swapu reverse ] keep
  swap def ;

\ ndrop [ dup ] def-generic
\ ndrop 0 [ drop ] def-method
\ ndrop :else [ swap drop 1 - ndrop ] def-method

[ x y ] [ x y z 1 ndrop ] unit-test
[ x   ] [ x y z 2 ndrop ] unit-test
[     ] [ x y z u v 5 ndrop ] unit-test

\ fact [ dup 0 == ] def-generic
\ fact true  [ drop 1 ] def-method
\ fact false [ dup 1 - fact * ] def-method

[ ( 1 1 2 6 24 120 720 ) ] [ [ 0 1 2 3 4 5 6 ] [ fact ] map ] unit-test

Contribute — propose a file extension

Tell us where to find evidence about Consize (mapped to pl/consize). 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/Consize/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← consim Constantinople →