Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added convinience methods to Sexp and Atom #11

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

eytans
Copy link

@eytans eytans commented May 30, 2023

This pull request adds concise type-checking and value extraction methods to the existing sexp parsing library. These additions are particularly useful when expecting a specific format of an s-expression. The changes include:

In the Atom struct:
    Added methods for checking if the atom is a string, integer, or float.
    Added methods for extracting the string, integer, or float value from the atom.

In the Sexp enum:
    Added methods for checking if the s-expression is an atom or a list.
    Added methods for extracting the atom or list from the s-expression.

These new methods provide a convenient way to validate and extract values from atoms within s-expressions, allowing for easier handling of expected formats. This enhances the usability and flexibility of the library when working with specific types of atoms within s-expressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant