# Moonbit Deprecated Syntax

> Tracks deprecated MoonBit syntax to avoid generating invalid code. Reference this before writing MoonBit code. Auto-maintained when deprecated patterns are discovered. Use when this capability is needed.

- Skill: `tomevault-io/moonbit-deprecated-syntax` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/moonbit-deprecated-syntax`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/moonbit-deprecated-syntax/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/moonbit-deprecated-syntax

---


# MoonBit Deprecated Syntax Reference

Reference this skill before generating MoonBit code to avoid deprecated patterns.

## Deprecated Patterns

### Error Propagation: `!` suffix (DEPRECATED)

**Old syntax (deprecated):**
```moonbit
let result = may_fail()!  // WRONG: ! suffix
```

**Current syntax:**
```moonbit
// Automatic propagation when caller also declares `raise`
fn caller() -> T raise E {
  let result = may_fail()  // Errors propagate automatically
}

// Or explicit try/catch
try {
  may_fail()
} catch {
  e => handle(e)
}
```

### Labeled Arguments: `~` prefix vs suffix

**Old syntax (deprecated):**
```moonbit
fn foo(~label : Int) -> Unit  // WRONG: ~ prefix
foo(~label=42)                // WRONG: ~ prefix in call
```

**Current syntax:**
```moonbit
fn foo(label~ : Int) -> Unit  // Correct: ~ suffix
foo(label~=42)                // Correct: ~ suffix in call
foo(label=42)                 // Also valid without ~
```

---

## Maintenance

When the AI generates code that fails due to deprecated syntax:
1. Add the deprecated pattern to this file
2. Include the old (wrong) and new (correct) syntax
3. Add a brief explanation

This file is the source of truth for deprecated MoonBit patterns in this project.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/dowdiness) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-15 -->

