# Copyright 2005-2007 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ ? def := ; null ? def makeAstroTag := # value: ? def tag := makeAstroTag(44, "foo", nullOk) # value: ? tag == makeAstroTag(44, "foo", nullOk) # value: true ? tag != makeAstroTag(null, "foo", nullOk) # value: true ? [tag.getOptTagCode(), tag.getTagName(), tag.getDataGuard()] # value: [44, "foo", nullOk] XXX EoJ tags respond to isTagForData/1, op__cmp/1 ? def makeTerm := # value: ? makeTerm(tag, 99, null, []) # problem: must be null ? def term := makeTerm(tag, null, null, []) # value: term`foo` ? def nestedTerm := makeTerm(makeAstroTag(null, "bar", nullOk), null, null, [term]) # value: term`bar(foo)` Term guard ? def Term := makeTerm.asType() # value: Term ? Term == # value: true Basic accept/reject ? "foo" :Term # problem: not a Term: "foo" ? term :Term # value: term`foo` Terms can hold arbitrary data, but are not 'standard' Terms ? def termBadData := makeTerm(makeAstroTag(44, "bar", any), def x {}, null, []) # value: term`bar` ? termBadData :Term # problem: doesn't match any of [nullOk, int, float64, char, Twine] Terms can hold arbitrary children, but ditto. ? def termNonTree := makeTerm(tag, null, null, ["bar"]) # value: term`foo("bar")` ? termNonTree :Term # problem: not a Term: "bar" ? def LooseTerm := Term[any, any, any] # value: Term[any, any, any] ? termNonTree :LooseTerm # value: term`foo("bar")` ? termBadData :LooseTerm # value: term`bar` XXX test tag restrictions ? term.getTerms() # value: [term`foo`] ? makeTerm(tag, null, null, [term]).withoutArgs() # value: term`foo`