Writer’s Block and Keyword Madlibs

I have writer’s block.

I decided on prototypal inheritance for Yap a few weeks ago, as I want to keep the interpreter as simple as possible and classical inheritance adds lots of plumbing. Anyway, to pull it off, I don’t NEED any new keywords, as I could just offer some intrinsic functions that set up and test for inheritance (such as inherits() and instanceof()). However, I want the code to flow a little better than that, and I want to choose keywords that can be combined togther and not sound completely ridiculous.

On top of all of this, I’d like to make a keyword whose sole job is to provide a block for instantiating functions, much like how a class block would act in another language. Any functions defined in that block would be added to the object referenced in the block’s creation.

Every time my brain has gone idle in the last few weeks, it slowly works its way back to playing madlibs with two or three possible constructs that I want to be valid. I figured I’d share this game of madlibs in case someone out there has a brilliant combination of keywords that just “feels right”. Here we go:

# __A__ : a keyword which creates a block of functions to attach to an
#         expression
# __B__ : a keyword which causes its LHS to be inherited from its RHS
#         (and if LHS is null, make it a fresh object)
# __C__ : a keyword which returns boolean true if LHS inherits from RHS
#         (must be different from __B__!)

# The __C__ keyword isn't going to be listed in the madlibs below, but it
# must fit thematically with them, and would look something like:

# if Car __C__ Vehicle ...

# Pretend that I've implemented an object named Vehicle, and I would like
# to override a few functions in an inherited object named Car. Here are the
# madlibs that must ALL "not feel terrible":

# Note: the __A__ block will be allowed multiple times for a single object,
# so don't choose something that sounds too "final".

# ---

var Car
Car __B__ Vehicle
__A__ Car
    block_of_functions_for_car
    block_of_functions_for_car

# ---

var Car __B__ Vehicle
__A__ Car
    block_of_functions_for_car
    block_of_functions_for_car

# ---

var Car
__A__ Car __B__ Vehicle
    block_of_functions_for_car
    block_of_functions_for_car

# ---

__A__ var Car __B__ Vehicle
    block_of_functions_for_car
    block_of_functions_for_car

# ---

# Brainstorming possibilities:

# __A__:
# with
# into
# extend
# extending
# build
# bloat
# using
# append
# appending
# grow

# __B__:
# from
# inherits
# overrides
# continues

# __C__:
# isa
# instanceof
# overrides
# continues

Hopefully you can see through the crazy in this post and understood what I need help with!

Posted in Blog