Comments (5)
This issue can be workaround by specifying a return value in 'myand definition. Currently the implementation requires that infix functions have a return type, I need to check the code to see if this dependency can be removed or if I need to add it to the specification draft.
from red.
That workaround has itself a problem: the infix function may be polymorphic! At least 'myand is, since it is a copy of 'and. Are you planning to allow more than one type in argument and return specs?
from red.
`myand' is part of an expression where it will be evaluated first (expressions are reduced from left to right reduction), so it requires parens on his right expression argument, else a compilation error will occur:
With parens:
17 myand (13 + 1)
, it is reduced to the prefix form: myand 17 + 13 1
Without parens:
17 myand 13 + 1
, it is reduce to the prefix form: + myand 17 13 1
*** Compilation Error: return type missing in function: myand *** in: %tests/test.reds *** at: [myand 17 13 1 ]
from red.
I fail to see what is wrong with + myand 17 13 1 ! Since myand has two arguments, 17 and 13, it will yield an integer that can be added to 1 by +.
from red.
It is not allowed to yield any value without a proper [return:] declaration in the function specification block. In my examples, in both cases, I have used your function declaration (so without any [return:] declaration).
In the "with parens" example, 'myand doesn't need to return anything as it is the root of the expression, so the compiler let it pass. In the "without parens" example, 'myand needs to return a value to be used as argument for '+ operator, in contradiction to 'myand specification block, so the compiler raises an error.
from red.
Related Issues (20)
- event/away? stays false when mouse exit face whil LMB is down HOT 6
- email accepts ' which is not allowed HOT 4
- Using wrap VID keyword resets para values.
- There is a conflict between ALL-OVER and DOWN and AWAY flags.
- Set operations welcome optimizations HOT 4
- A CRASH happens when using IN to access a member of an ERROR!.
- JSON interoperability issue HOT 6
- Some operations on complement bitsets are wrong HOT 3
- Changing font size and LINE-SPACING in DRAW's RICH-TEXT "disalignes" the BACKDROP.
- Malformed JPG can crash console session HOT 8
- Path may render error message meaningless HOT 1
- Bitsets equality compares implementation artifacts, not actual bit values
- Misleading 'duplicate refinement' error HOT 4
- Release stable versions on website for each tag
- WindowsXP compile target does not work for any source: error in draw-gdi.reds, in function: exec/gui/draw-begin
- VID actors syntax errors are not caught
- Native builds do not run under Windows XP even with WindowsXP target: calls D3D11 which is not supported on XP HOT 5
- Promotion inconsistency in `min/max pair float`
- Using point2D! as SIZE for a TAB-PANEL makes its children not to be shown.
- GROUP-BOX frame is not always conforming to its size. HOT 3
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 red.