Comments (6)
@thadguidry kinda. The advantage we have is that we have no polymorphism, so it can be hopefully easier.
from abstracttext.
Something like Type Erasure in Java? https://www.baeldung.com/java-generics#type-erasure
This JEP218 might also provide some food for thought in the greater context of parametric polymorphism.
from abstracttext.
So what would be the 'type' of Z8 then? Function(Type, [Type, List])? I don't quite see how this works, but it sounds intriguing... How would you express that in json?
In general I think we need to think a bit more about inheritance here. There is already something implicit here with Z1 - zobject as a type; I don't think you have any entity so far that is explicitly of type Z1, but Z1 encompasses all types, so that an object that takes a Z1 argument is actually able to accept any type. So maybe explicitly typed functions (with return type and arguments) can coexist here with a general Z8 - rather than change the meaning of Z8 as it is, perhaps new zobjects should be created for the generics?
from abstracttext.
@arthurpsmith yes, that's a great point. I was hoping that the type of the add function would indeed be something like Function(Boolean, [Boolean, Boolean])
In JSON notation, we first would need a Quote mechanism, say, Z99 is the same as Z7 but it is quoted (as in Lisp). So Add would look like:
{
"Z1K1": "Z8",
"Z1K2": "Z57",
But it could look like this instead:
{
"Z1K1": {
"Z1K1: "Z99",
"Z99K1": "Z8",
"Z8K1": "Z50",
"Z8K2": [ "Z50", "Z50" ]
},
"Z1K2": "Z57",
Now if you unquote the Z99, you'll get
"Z1K1: "Z7",
"Z7K1": "Z8",
"Z8K1": "Z50",
"Z8K2": [ "Z50", "Z50" ]
which is the function call Z8(Z50, [Z50, Z50])
, and when that is evaluated we get a new object of type Z4.
But we can use the quoted function for checking that is a function and its argument types easily.
Now as you point out, Z1 is a form of any type already. So should there be something like an any-function type, and probably yes, because what else would be the the signature of a function such as Z592 signature? (Hmm, could it be Z8(Z1, Z1), though?)
So unsure about the latter thing.
Thoughts are welcome.
from abstracttext.
The quoting approach might be reasonable. Presumably it could be nested? So you could have
{
"Z1K1": {
"Z1K1": "Z99",
"Z99K1": "Z8",
"Z8K1": {
"Z1K1": "Z99",
"Z99K1": "Z8",
"Z8K1": "Z50",
"Z8K2": ["Z50"]
}
"Z8K2": [ "Z50", "Z50" ]
},...
if you wanted the function to return a function rather than a number or whatever Z50 is?
Without something like that we would get a combinatorial explosion of types...
from abstracttext.
Yes, absolutely!
from abstracttext.
Related Issues (15)
- How to handle transliteration in some languages? HOT 8
- Discussion - namespace of functions and other types HOT 3
- Cannot evaluate unlinearized (JSON) version of value(project_name) call HOT 4
- new Dataset type (to apply functions over sets of tables) HOT 1
- editing? HOT 15
- Document requirements for minimum implementation/kernel HOT 4
- value(true) and value(false) produce errors HOT 2
- ReferenceError in measure.js HOT 3
- Question about using named arguments with named references HOT 3
- JSON data table stays empty (Invalid argument supplied for foreach() in JsonContent.php) HOT 3
- Document meaning of alpha/beta functions HOT 15
- Infinite recursion in normal representation of type (Z1K1)? HOT 5
- Tests - status? HOT 2
- Special pages? HOT 28
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abstracttext.