Skip to content

Conversation

@gus-massa
Copy link
Contributor

In particular, even?, odd?, positive?, negative?, real-valued? and similar primitives.

The support is only partial. It's enough to specialize

(lambda (x) (when (fixnum? x) (positive? x)))
==>
(lambda (x) (when (fixnum? x) (fxpositive? x)))

but it's not enough to reduce

(lambda (x) (when (positive? x) (positive? x)))
==>
(lambda (x) (when (positive? x) #t))

that require a big refinement in the internal type system (planed for later, let's say mid 2026).


In primdata.ss/primvars.s I renamed nzuint to pint because all the other types use that convention.

I also made a few new types, to complement the old types:

  • fixnum: all fixnums (some other types use an s, like sint, so perhaps it shoud be sfixnum)
  • pfixnum: positive, i.e. >0
  • nfixnum: (new) negative, i.e. <0
  • ufixnum: unsigned/"up", i.e. >=0
  • dfixnum: (new) ???/"down", i.e. <=0

I didn't find a nice name/letter for "<=0", but since u is used for unsigned ">=0", we can reinterpret is as up/down. The letter d is visually different from the others letters to be easy to notice, and it a nice mnemonic.

In particular, even?, odd?, positive?, negative?,
real-valued?, and similar primitives.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant