prototype-3x5/src/lib/expr.ts

13 lines
366 B
TypeScript
Raw Normal View History

2023-10-21 01:02:27 +00:00
import { AsText, ProcResult, TextPiece } from "../words";
export function Expr({}, argv: TextPiece[]): ProcResult {
const name = argv[0];
if ("bare" in name && name.bare == "expr") {
// being called as [expr ...], not fallback for math
argv.splice(0, 1);
}
return {
text: `Will do math to solve ${argv.map(AsText).join(" ")} eventually`,
};
}