This instance will be upgraded to Heptapod 0.25.0 (final) on 2021-09-22 at 15:00 UTC+2 (a few minutes of down time)

Commit aefa18a7 authored by Jesse McGrew's avatar Jesse McGrew
Browse files

Implemented the GENERIC property, with which objects can define a routine to

assist with disambiguation.
parent 759d57807221
......@@ -129,6 +129,7 @@ other versions. These macros let us write the same code for all versions."
<PROPDEF ARTICLE <>>
<PROPDEF PRONOUN <>>
<PROPDEF THINGS <>>
<PROPDEF GENERIC <>>
"Parser"
......@@ -1940,6 +1941,10 @@ Returns:
<COND (<N=? .BITS .OBITS>
<SET BITS .OBITS>
<AGAIN .BITS-SET>)>
<COND (<SET F <APPLY-GENERIC-FCN .OUT>>
<PUT/B .OUT 1 .F>
<PUTB .OUT 0 1>
<RETURN .F>)>
<WHICH-DO-YOU-MEAN .OUT>
<COND (<=? .NP ,P-NP-DOBJ> <ORPHAN T AMBIGUOUS PRSO>)
(ELSE <ORPHAN T AMBIGUOUS PRSI>)>
......@@ -1952,6 +1957,12 @@ Returns:
<NOT <OR <FSET? .OBJ ,TAKEBIT>
<FSET? .OBJ ,TRYTAKEBIT>>>>>>>
<ROUTINE APPLY-GENERIC-FCN (TBL "AUX" (MAX <GETB .TBL 0>) F R)
<DO (I 1 .MAX) (END <RFALSE>)
<SET F <GETP <GET/B .TBL .I> ,P?GENERIC>>
<COND (<SET R <APPLY .F .TBL>>
<RETURN .R>)>>>
<ROUTINE WHICH-DO-YOU-MEAN (TBL)
<TELL "Which do you mean, ">
<LIST-OBJECTS .TBL <> %<+ ,L-PRSTABLE ,L-THE ,L-OR>>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment