-
Notifications
You must be signed in to change notification settings - Fork 47
String library #675
Comments
What happened to the stdlib repo? |
Lol, if you were hanging around irc, you would've know that me an @MovingtoMars agreed that it would be less of a hassle to keep the stdlib in the main repo, as to not have to deal with subtrees/-modules. |
@kiljacken Yeah I'm cool with that, been a little bit busy with college currently so I'm not as active 🥚 |
What is the data layout of the string type that Ark users should use? Ark's standard library makes a call to |
Arks standard |
where do you allocate the memory to do the conversion? |
We don't, currently, but I'd like functions for automatically allocating on On Mon, 29 Feb 2016 01:07 Andrew Kelley, [email protected] wrote:
|
@kiljacken Woops 🌚 |
In relation to my earlier comment on conversion between ark and c string, here is the imagined signatures of the functions we'd want:
I imagine that these would possibly be (static) methods on string, which would depend on #716. |
LGTM On a (semi-related) note, if we were to approve #716, would it be weird to have an alias for a byte pointer that is |
That would certainly be nice, from both usability and readability standpoints. |
would there be a way to seperate the heap and stack allocation of the strings. you sometimes pass in the data and you have another one that does the allocation for you, its a lot like c |
@danharbor95 The idea would be that we'd have some way to allocate raw memory on the stack, and then you can use the versions where you pass in a destination pointer. |
so like mem alloc but for the stack? |
@danharbor95 Yes, that's the idea. |
We don't need both WrapZeroTerminated and FromZeroTerminated. Just using memcpy then WrapZeroTerminated is equivelant to FromZeroTerminated. |
@MovingtoMars Well, the idea here is ease of use. We might as well provide a function ( |
I think it's complicating the API for too little gain. |
@MovingtoMars Well, we'll just have to agree to disagree on this then. I do not think it thing it complicates the API any amount worth worrying about, an thus I believe that the usability gain far outweighs any concern about complexity in this case.. |
I'd be happier to include it if the names were better. Those names aren't distinct enough; it isn't clear what the differences are. |
@MovingtoMars I already acknowledged that the names were far from final in the original suggestion. They were simply there to get my ideas across.
You're free to help come up with better names. |
Gonna have to say I agree with @kiljacken here on this one, the naming isn't pretty but I'm sure things will be cleaner. Especially if we approve #716 😉 |
From @felixangell on January 18, 2016 15:30
String concatenation, destroying strings, substring, etc... also iterating through strings, length, blah blah blah
Copied from original issue: ark-lang/stdlib#3
The text was updated successfully, but these errors were encountered: