k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Radu Mereuta <headness13 AT gmail.com>
- To: Omar Duhaiby <3omarz AT gmail.com>
- Cc: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>, "Musab A. AlTurki" <musab AT kfupm.edu.sa>
- Subject: Re: [K-user] structs
- Date: Mon, 17 Nov 2014 10:47:35 -0600
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
You can define whatever syntax you wish for your tuple, as long as it doesn't conflict with other pieces of syntax.
In some of our examples, we used the following syntax:
syntax CowStruct ::= (Int, Id)
But it's your choice.
All you need to do, is to put these elements in one of the builtin lists (either Set, or List).
Hope this helps,
Radu,
K developer
On Fri, Nov 14, 2014 at 11:42 AM, Omar Duhaiby <3omarz AT gmail.com> wrote:
This is a bit tricky. I need for one of my cells to contain a list of CowStructs, where CowStruct is any arrangement of two sorts, an Int and an Id. I defined it as:
syntax CowStruct ::= Int "." Id
I chose this format arbitrarily. What I need is something like a struct that contains these two types.I hope my question is clear.
Thank you
Omar Alzuhaibi
_______________________________________________
k-user mailing list
k-user AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/k-user
- [K-user] structs, Omar Duhaiby, 11/14/2014
- Re: [K-user] structs, Radu Mereuta, 11/17/2014
Archive powered by MHonArc 2.6.16.