Comments (15)
no it doesn't convert to string implicitly, to do that u will have to convert int to string first and then u can concat them.
to convert int to string, u can do the following:
5.to_str()
from ethereal.
Shouldn't it happen automatically though? At least most other langs do.
from ethereal.
Think it would be pretty easy to add the +
operator in the str
module. I can do it now if you want.
from ethereal.
Can't figure out how to do it lol. Leaving it for now.
from ethereal.
Well, it's ok. I shall perhaps do it. Although I do feel it to be not too useful
from ethereal.
to_str() converts any type to string so it should be just fine, although i can make a short hand style for it maybe.
how about something like...
str( /* anything */ )
?
from ethereal.
Yeah maybe.
from ethereal.
Also I have a weird bug.
I have this script:
println( 'height: ' + term.height.to_str() );
But it errors out when I run it with:
mod_term.et 11[20]: error: function with name '+' and arg count 2 (str, str) does not exist
println( 'width: ' + term.width.to_str() );
from ethereal.
I reverted all my changes to do with operators and strings fyi.
from ethereal.
Did you import str;
? Also, for println, you can just pass all arguments using comma separation instead of manually concatenating the strings.
from ethereal.
Oh haha, I didn't import it. Thanks for the tip as well.
from ethereal.
No problem :)
I wonder if I should just add the string concatenation, append, and comparison functions in the core module...
from ethereal.
Starting work on it again now.
from ethereal.
okay, good luck
from ethereal.
I think I will not let a string and any other type be added directly. This is because someone may accidentally concatenate two variables if they don't know one of them is string (which is entirely possible due to the dynamically typed nature of the language).
I shall consider more on this, but for now, I'll close this issue. Thanks! :)
from ethereal.
Related Issues (11)
- Add terminal related functions (like term width, height) in libterm HOT 31
- More test programs/scripts
- Add benchmarks HOT 3
- Add complex library (std.complex) HOT 1
- Fix / update README.md in VSCode extension HOT 3
- `tests/mem_funcs.et` test has two `#!./buildfiles/et`'s
- Compile Ethereal VM to wasm HOT 1
- Create a CMake/Make build script HOT 3
- How do you deal with circular references? HOT 1
- Add Windows support
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 ethereal.