The static term is overly applied

I have a function definition (a c interface) that (currently) looks like:

fun
newmodel {n,nv:nat} (
env: env, model: &model, mname: String (n),
numvars: int (nv), obj: cPtr0(double),
lb: cPtr0(double), ub: cPtr0(double),
vtype: String, varnames: stringlst_vt): int

The String (n) argument gives the error “the static term is overly applied.”

Somewhat unrelatedly, I’m almost sure I can’t directly past stringlst_vt to
something that expects char** - I’ll probably try to use templates to
convert each string to a concatenated sequence of chars.

It means the type I’m using doesn’t take additional sorts as arguments: I
should be using just string, which can be equivalent to strint_int_type (n:
int) :

abstype
string_type = ptr // = char* in C
abstype
string_int_type (n: int) = string_type
//
stadef string0 = string_type
stadef string1 = string_int_type
stadef string = string1 // 2nd-select
stadef string = string0 // 1st-select
typedef String = [n:int] string_int_type (n)
typedef String0 = [n:int | n >= 0] string_int_type (n)
typedef String1 = [n:int | n >= 1] string_int_type (n)

Brandon Barker
brandon…@gmail.comOn Fri, Jan 24, 2014 at 2:28 AM, Brandon Barker brandon...@gmail.comwrote:

I have a function definition (a c interface) that (currently) looks like:

fun
newmodel {n,nv:nat} (
env: env, model: &model, mname: String (n),
numvars: int (nv), obj: cPtr0(double),
lb: cPtr0(double), ub: cPtr0(double),
vtype: String, varnames: stringlst_vt): int

The String (n) argument gives the error “the static term is overly
applied.”

Somewhat unrelatedly, I’m almost sure I can’t directly past stringlst_vt
to something that expects char** - I’ll probably try to use templates to
convert each string to a concatenated sequence of chars.


You received this message because you are subscribed to the Google Groups
“ats-lang-users” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/b39f6dc6-cc29-427d-af57-d22f308b1937%40googlegroups.com
.

Should use ‘string’ instead of ‘String’; string is a non-dependent type.On Friday, January 24, 2014 9:18:07 AM UTC-5, Brandon Barker wrote:

Anyway, I think at this low-level, since I’m already using cPtr for other
args, and especially for this argument where there any size string will do,
it really doesn’t make sense to use a string (n), so I just switched back
to String.

Brandon Barker
brand...@gmail.com <javascript:>

On Fri, Jan 24, 2014 at 9:06 AM, Brandon Barker <brand...@gmail.com<javascript:> wrote:

It means the type I’m using doesn’t take additional sorts as arguments: I
should be using just string, which can be equivalent to strint_int_type (n:
int) :

abstype
string_type = ptr // = char* in C
abstype
string_int_type (n: int) = string_type
//
stadef string0 = string_type
stadef string1 = string_int_type
stadef string = string1 // 2nd-select
stadef string = string0 // 1st-select
typedef String = [n:int] string_int_type (n)
typedef String0 = [n:int | n >= 0] string_int_type (n)
typedef String1 = [n:int | n >= 1] string_int_type (n)

Brandon Barker
brand...@gmail.com <javascript:>

On Fri, Jan 24, 2014 at 2:28 AM, Brandon Barker <brand...@gmail.com<javascript:> wrote:

I have a function definition (a c interface) that (currently) looks like:

fun
newmodel {n,nv:nat} (
env: env, model: &model, mname: String (n),
numvars: int (nv), obj: cPtr0(double),
lb: cPtr0(double), ub: cPtr0(double),
vtype: String, varnames: stringlst_vt): int

The String (n) argument gives the error “the static term is overly
applied.”

Somewhat unrelatedly, I’m almost sure I can’t directly past stringlst_vt
to something that expects char** - I’ll probably try to use templates to
convert each string to a concatenated sequence of chars.


You received this message because you are subscribed to the Google
Groups “ats-lang-users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to ats-lang...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com<javascript:>
.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/b39f6dc6-cc29-427d-af57-d22f308b1937%40googlegroups.com
.

Here is my guess:

abstype varname = string

fun
newmodel{nv:int}
(
env: env,
model: &model, mname: string,
numvars: int (nv), obj: cPtr0(double), lb: cPtr0(double), ub: cPtr0(double),
vtype: string, varnames: &array(varname, nv)
): int

If a string value can be NULL, then use stropt instead.On Friday, January 24, 2014 2:28:35 AM UTC-5, Brandon Barker wrote:

I have a function definition (a c interface) that (currently) looks like:

fun
newmodel {n,nv:nat} (
env: env, model: &model, mname: String (n),
numvars: int (nv), obj: cPtr0(double),
lb: cPtr0(double), ub: cPtr0(double),
vtype: String, varnames: stringlst_vt): int

The String (n) argument gives the error “the static term is overly
applied.”

Somewhat unrelatedly, I’m almost sure I can’t directly past stringlst_vt
to something that expects char** - I’ll probably try to use templates to
convert each string to a concatenated sequence of chars.

Anyway, I think at this low-level, since I’m already using cPtr for other
args, and especially for this argument where there any size string will do,
it really doesn’t make sense to use a string (n), so I just switched back
to String.

Brandon Barker
brandon…@gmail.comOn Fri, Jan 24, 2014 at 9:06 AM, Brandon Barker brandon...@gmail.comwrote:

It means the type I’m using doesn’t take additional sorts as arguments: I
should be using just string, which can be equivalent to strint_int_type (n:
int) :

abstype
string_type = ptr // = char* in C
abstype
string_int_type (n: int) = string_type
//
stadef string0 = string_type
stadef string1 = string_int_type
stadef string = string1 // 2nd-select
stadef string = string0 // 1st-select
typedef String = [n:int] string_int_type (n)
typedef String0 = [n:int | n >= 0] string_int_type (n)
typedef String1 = [n:int | n >= 1] string_int_type (n)

Brandon Barker
brandon...@gmail.com

On Fri, Jan 24, 2014 at 2:28 AM, Brandon Barker brandon...@gmail.comwrote:

I have a function definition (a c interface) that (currently) looks like:

fun
newmodel {n,nv:nat} (
env: env, model: &model, mname: String (n),
numvars: int (nv), obj: cPtr0(double),
lb: cPtr0(double), ub: cPtr0(double),
vtype: String, varnames: stringlst_vt): int

The String (n) argument gives the error “the static term is overly
applied.”

Somewhat unrelatedly, I’m almost sure I can’t directly past stringlst_vt
to something that expects char** - I’ll probably try to use templates to
convert each string to a concatenated sequence of chars.


You received this message because you are subscribed to the Google Groups
“ats-lang-users” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/b39f6dc6-cc29-427d-af57-d22f308b1937%40googlegroups.com
.