-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expose autocannonize func for keyexpr wrapper #101
base: main
Are you sure you want to change the base?
expose autocannonize func for keyexpr wrapper #101
Conversation
PR missing one of the required labels: {'breaking-change', 'bug', 'dependencies', 'documentation', 'enhancement', 'internal', 'new feature'} |
/* | ||
* Returns true if the keyexprs intersect, i.e. there exists at least one key which is contained in both of the sets defined by self and other. | ||
*/ | ||
autocanonize(other: IntoKeyExpr): KeyExpr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment is incorrect. Also this should be free function, it doesn't use "this".
Probably this require to make "call_wasm" free function too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or make this method static, ts allows this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call_wasm
is just a function that is part of the keyexpr class, to abstract away return types and function calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just wondering why autocanonize
is a method of already created KeyExpr? This function should accept string and create key new expression. I.e. this is a constructor. It can be implemented like this:
class KeyExpr {
...
public static autocanonize(s: string): KeyExpr | null {
const key_expr = ??? call_wasm<String>(s, autocanonize);
// we should be able to call wasm without `this`
if key_expr.is_ok() { // not sure how to really check it to ok
return new KeyExpr(key_expr)
} else {
return null; // TODO: it is the way how we fail in zenoh_ts? Need to check
}
}
}
@@ -6,6 +6,10 @@ export function join(a: number, b: number, c: number, d: number, e: number): voi | |||
export function concat(a: number, b: number, c: number, d: number, e: number): void; | |||
export function includes(a: number, b: number, c: number, d: number, e: number): void; | |||
export function intersects(a: number, b: number, c: number, d: number, e: number): void; | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
garbage in file, build is passed only because this file is regenerated on build
/* | ||
* Returns true if the keyexprs intersect, i.e. there exists at least one key which is contained in both of the sets defined by self and other. | ||
*/ | ||
autocanonize(other: IntoKeyExpr): KeyExpr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just wondering why autocanonize
is a method of already created KeyExpr? This function should accept string and create key new expression. I.e. this is a constructor. It can be implemented like this:
class KeyExpr {
...
public static autocanonize(s: string): KeyExpr | null {
const key_expr = ??? call_wasm<String>(s, autocanonize);
// we should be able to call wasm without `this`
if key_expr.is_ok() { // not sure how to really check it to ok
return new KeyExpr(key_expr)
} else {
return null; // TODO: it is the way how we fail in zenoh_ts? Need to check
}
}
}
Add Key Expr Wasm functionality.