Skip to content

To support strings as lists#4

Open
japeto wants to merge 2 commits intoandcastillo:masterfrom
japeto:master
Open

To support strings as lists#4
japeto wants to merge 2 commits intoandcastillo:masterfrom
japeto:master

Conversation

@japeto
Copy link

@japeto japeto commented Apr 29, 2020

We can work with lists and strings. A common lists contain a number of items and common string contain a number of characters. Both can be treated as list ADT where:

  • "" is empty string.
  • " " is one element string, whitespaces also treated as characters.
  • "abcd" is similar to cons('a', cons('b', cons('c', cons('d', empty))))

strings and lists behave so similarly.

japeto added 2 commits April 29, 2020 10:25
A string to list of characters and ("") is empty too.
add a function to test if something is a string.
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