feat(research): add operation syntax idea
This commit is contained in:
@@ -13,3 +13,7 @@
|
|||||||
- Kickoff meeting with Prof. Racordon
|
- Kickoff meeting with Prof. Racordon
|
||||||
- Setup repositories
|
- Setup repositories
|
||||||
- Start experimenting with syntax ideas
|
- Start experimenting with syntax ideas
|
||||||
|
|
||||||
|
|
||||||
|
#day(3)
|
||||||
|
- Research syntax prototype
|
||||||
@@ -175,3 +175,25 @@ type GeoCoordinates<Latitude, Longitude>{
|
|||||||
lon Longitude
|
lon Longitude
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Operations
|
||||||
|
|
||||||
|
### Custom syntax - without Python constructs
|
||||||
|
|
||||||
|
```python
|
||||||
|
type Latitude<float>
|
||||||
|
type Longitude<float>
|
||||||
|
type LatitudeDiff<float>
|
||||||
|
type LongitudeDiff<float>
|
||||||
|
type Distance<float>
|
||||||
|
|
||||||
|
op <Latitude> - <Latitude> = <LatitudeDiff>
|
||||||
|
op <Longitude> - <Longitude> = <LongitudeDiff>
|
||||||
|
|
||||||
|
op <LatitudeDiff> + <LatitudeDiff> = <LatitudeDiff>
|
||||||
|
op <LongitudeDiff> + <LongitudeDiff> = <LongitudeDiff>
|
||||||
|
op <LatitudeDiff> - <LatitudeDiff> = <LatitudeDiff>
|
||||||
|
op <LongitudeDiff> - <LongitudeDiff> = <LongitudeDiff>
|
||||||
|
|
||||||
|
op <GeoCoordinates>.distance(<GeoCoordinates>) = <Distance>
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user