Scheme abstracts data in what way?
1 reply



18.07.22 03:50:21 pm
In a statically typed language, users can abstract data and produce constructors using algebraic data types, or they can deal with data abstraction using class, trait, and mixin.
Users can access a class system in dynamically typed languages such as Python and Ruby.
But how can scheme, the simplest functional language and the closest to -calculi, abstract data?
Is it common for scheme programmers to just put data in a list or a lambda abstraction and then build some accessor function to make it appear like a tree or anything else? as stated by EOPL: data specification through interfaces.
Then, what is the relationship between this abstraction approach and abstract data types (ADT) and objects?
Users can access a class system in dynamically typed languages such as Python and Ruby.
But how can scheme, the simplest functional language and the closest to -calculi, abstract data?
Is it common for scheme programmers to just put data in a list or a lambda abstraction and then build some accessor function to make it appear like a tree or anything else? as stated by EOPL: data specification through interfaces.
Then, what is the relationship between this abstraction approach and abstract data types (ADT) and objects?
I've never worked with Scheme itself, only one of its derivatives, but data abstraction is pretty straightforward, as outlined here:
http://mngu2382.github.io/sicp/chapter2/00-notes01.html
Or for classes (in a way I find not dissimilar to JavaScript):
https://homes.cs.aau.dk/~normark/prog3-03/html/notes/oop-scheme_themes-classes-objects-sec.html
As far as I'm aware, trees are just nested lists.
What is your use case for data structures in Scheme?
I thought it was just a language taught to first-years at Uni to better explain concepts like recursion, so I'm guessing this is for some kind of homework?
http://mngu2382.github.io/sicp/chapter2/00-notes01.html
Or for classes (in a way I find not dissimilar to JavaScript):
https://homes.cs.aau.dk/~normark/prog3-03/html/notes/oop-scheme_themes-classes-objects-sec.html
As far as I'm aware, trees are just nested lists.
What is your use case for data structures in Scheme?
I thought it was just a language taught to first-years at Uni to better explain concepts like recursion, so I'm guessing this is for some kind of homework?

Hador



