Skip to content

push doesn't need to be a macro (nit pick) #59

Description

@dragoncoder047

Not sure if one of the goals of uLisp is to be easily understandable, but since Arduino is C++ why not take advantage of it?

//                               vv----------& makes the parameter a pass-by-reference
void push (object *thing, object *&stack) {
  object *cell = cons(thing, stack);
  stack = cell; // because stack is pass-by-reference this updates the caller's variable
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions