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.

@gus-massa gus-massa force-pushed the 26-1-PredicatesFxFl branch from 5095b27 to e91c2a0 Compare January 19, 2026 15:04
@gus-massa
Copy link
Contributor Author

I just removed the bootfiles that were not necesary.

@mflatt mflatt force-pushed the 26-1-PredicatesFxFl branch from e91c2a0 to 0342b35 Compare January 23, 2026 14:18
Copy link
Contributor

@mflatt mflatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased to resolve conflict in "release_notes.stex".

@gus-massa gus-massa force-pushed the 26-1-PredicatesFxFl branch from 0342b35 to c3ed972 Compare January 24, 2026 15:42
Comment on lines 157 to 159
and similar functions. Also, it has partial support more numeric predicates, like
\scheme{even?}, \scheme{odd?}, \scheme{positive?}, \scheme{negative?},
\scheme{real-valued?} and similar.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also has partial support for more numeric predicates including even?, odd?, positive?, negative?, and real-valued?.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

In particular, even?, odd?, positive?, negative?,
real-valued?, and similar primitives.
@gus-massa gus-massa force-pushed the 26-1-PredicatesFxFl branch from c3ed972 to ac9023f Compare January 25, 2026 01:54
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.

3 participants