Camen Design Forum

Kroc's Work Log


Been on holiday, haven't coded much this month. Just poking at the OZ80 code to see where I need to continue.

For speed / simplicity, I want to be able to directly associate the Named Values (`::sections`, `:labels`, `.properties` &c.) to their Value-store; the syntax for differentiating property definition and use has reared its ugly head again and I need to come up with an aesthetic answer.

Within OZ80 I do not want to mandate any whitespace as I believe the author should have that flexibility available for themselves. Currently a property (a sub-routine within a Procedure, or a key in a Hash) is defined when it begins a new line, and is otherwise read. I am pained to come up with a good-looking syntax to separate the two.

% Some possibilities:
;#1. some kind of keyword to do the definition:
; pros: clarity, less burden on the more common property use
; cons: somewhat ugly, inconsistent with other forms of definitions (Hashes)
DEF .loop
    jp .loop

;#2. a 'self' prefix to use the property:
; pros: terse, `self` prefix may find use consistently elsewhere in the syntax
; cons: increases potential typos and places burden on the more common usage scenario
    jp ~.loop

;#3. conversely, a prefix to define a property:
; pros: terse, less burden on the usage scenario
; cons: consistently ugly and confusing, potentially inconsistent with other forms of definition 
    jp .loop


(Leave this as-is, it’s a trap!)

Only the original author or a moderator can append to this post.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn