Skip to content

Passing sets to procedures #545

@vsht

Description

@vsht

Hi,

is there a way to define procedures with arguments being sets of variables so that one can alternate between passing an empty set {} or a nonempty one?

Something naive like

#procedure proctest(SET)
id f(s?`SET') = s;
#endprocedure
s x,y, s;
cf f;

l exp = f(x)+f(y);

.sort
#call proctest({x,y})

print +s;
.end

complains about "Arguments of procedure proctest are not matching".

It actually does what I want for #call proctest({}) and #call proctest({x}) but I guess it's only because the preprocessor calculator kicks in here.

Cheers,
Vlad

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions