Some CTP changes in “M”

I did a couple of “Oslo” (now SQL Modeling) presentations at community events in the area in October and November.  My samples used the May CTP, and they broke with the November CTP that came out last week during CTP.  These are the changes needed to bring one of the simple samples (and any of your own “M” code) up to par with the latest CTP.  Here’s a link to the samples from the Tampa CodeCamp presentation: Samples

I haven’t gone through the entire spec document yet, just enough to get these samples compiling to SQL again, so there may be better ways to do some of these things.

So starting at the top, when defining a type and stating lengths for your fields, before you used the “# + number”, like this:

type Presenter

   {

       id : Integer32 => AutoNumber();

       Name: Text#100;

       URL: Text#50;

       Blog: Text#50;

   } where identity(id);

That format is no longer supported, so that same type definition is now: (Notice how the constraints changed)

type Presenter

    {

        id : Integer32 => AutoNumber();

        Name: Text where value.Count <=100;

        URL: Text where value.Count <=50;

        Blog: Text where value.Count <=50;

    } where identity(id);

Or a better, more SQL-like way (thanks Lars):

type Presenter

    {

        id : Integer32 => AutoNumber();

        Name: Text(100);

        URL: Text(50);

        Blog: Text(50);

    } where identity(id);

Then, to define the extent, before you did this:

Presenters:Presenter*;

Now, you have to put curly brackets around it:

Presenters:{Presenter*};

And for the Events extent:

Events:{(Event where value.PresentedBy in Presenters)*};

The reason for that is that they implemented ordered lists, which are represented with square brackets, so we have to specify that we are going for unordered.  Side note, surprisingly enough, they figured out a way to interpret ordered lists in SQL (seems a little odd when i first think about it), take a look here (scroll down to the comments).

Back to our sample model, adding data is still pretty straight forward, just like before, so no changes needed there. 

If you haven’t looked at the new CTP, you definitely should download it and play with it.  There’s some impressive new features, especially a ton of changes to Quadrant that give us productivity right now, even if it’s just CTP.  More on that later…

Here is the entire textual model, which works with the November CTP.  It is very basic, just used to introduce M.  It describes events, presenters, the model data, and adds a couple of transformations. 

module EventsSample

{

    type Event

    {

        id : Integer32 => AutoNumber();   

        Title: Text(100);

        PresentedBy: Presenter;

        Description: Text;

        EventDate:Date;

    } where identity(id);

    

    type Presenter

    {

        id : Integer32 => AutoNumber();

        Name: Text(100);

        URL: Text(50);

        Blog: Text(50);

    } where identity(id);

 

    

    Events:{(Event where value.PresentedBy in Presenters)*};

    Presenters:{Presenter*};

    

    Presenters

    {

        John{

            Name => "John",

            URL => "www.google.com",

            Blog => "www.test.com"

            },

        Mike{

            Name => "Mike",

            URL => "www.microsoft.com",

            Blog => "www.blogger.com"

        }

    }

 

    Events

    {

        {   Title => "Beginning C#",

            PresentedBy => Presenters.John,

            Description => "Talk about C#",

            EventDate => 2009-01-01

        },

        

        {   Title => "Beginning VB",

            PresentedBy => Presenters.Mike,

            Description => "Talk about VB",

            EventDate => 2009-02-01

        }    

    }

 

    UpcomingEvents(n:DateTime){

        from e in Events where e.EventDate > n select e.Title

        }

        

    //View

    PresenterNames() { from p in Presenters select p.Name}

 

}

114 thoughts on “Some CTP changes in “M”

  1. startbigthinksmall

    Hi,

    was good to see you at PDC!

    For Text#50 you can now do Text(50) much like in SQL 🙂

    – Lars

  2. Esteban Garcia

    Yeah, it was definitely great to see you there, and I owe you a beer for next time we meet.
    Thanks for the tip, it makes it much easier! I tried a few combinations and I missed the obvious…i couldn’t find that in the specs, so i used what the SQL to M functionality in Quadrant gave me. I’ll update the sample to show this.

  3. Renay Arelleano

    Howdy, I think your site might be having internet browser compatibility issues. When I take a look at your site in Safari, it looks fine however, when opening in I.E., it’s got some overlapping issues. I just wanted to give you a quick heads up! Aside from that, wonderful site!

  4. JeffreyArtig

    online cialis australia viagra cialis or levitra cialis generic vs brand

  5. JeffreyArtig

    new ed drugs ed men ed natural remedies

  6. JeffreyArtig

    no prescription female cialis cheapest cialis usa buy cialis withiut a prescription

  7. JeffreyArtig

    ivermectin and doxycycline heartworm treatment oral ivermectin for demodex rosacea ivermectin 2ml

  8. JeffreyArtig

    ingredients in cialis cialis usa prescription cialis 36 hour dosage

  9. JeffreyArtig

    generic medications cialis cialis usa cialis 5mg australia

  10. JeffreyArtig

    best online pharmacy prescription drugs online without natural ed pills

  11. RogerCom

    ivermectin cream uses milbemycin oxime vs ivermectin ivermectin sheep drench for humans

  12. RogerCom

    finasteride buy online cost of propecia buy finasteride online

  13. RogerCom

    cure ed what is the best ed pill male ed pills

  14. RogerCom

    ivermectin and alcohol consumption buying ivermectin online stromectol pill for humans

  15. RogerCom

    where to buy propecia online propecia 5 mg for sale propecia where to buy

  16. Normanspoib

    stromectol 12 mg tablets stromectol price usa stromectol for sale

  17. Normanspoib

    stromectol pills for humans stromectol for humans for sale stromectol for sale

  18. JohnnyDom

    tadalafil without a doctor’s prescription tadalafil 20 mg buy online cialis 20 mg price

  19. JohnnyDom

    sildenafil 100 mg viagra tablets for men sildenafil citrate tablets 100 mg

  20. JohnnyDom

    stromectol pills for humans prescribing stromectol stromectol for sale

  21. JohnnyDom

    stromectol stromectol for humans for sale stromectol for humans for sale

  22. JohnnyDom

    sildenafil sildenafil viagra tablets for men

  23. EddieNew

    ivermectin alternatives for humans stromectol for sale stromectol for sale

  24. EddieNew

    ivermectin new zealand stromectol tablets for humans stromectol for sale

  25. MichaelOmige

    viagra cost per pill viagra pills viagra over the counter walmart

  26. Homermaype

    cialis tadalafil generic cialis usa

  27. Homermaype

    which is better viagra or cialis tadalafil without a doctor’s prescription cialis women video

  28. Homermaype

    free samples for cialis cialis generic cialis price

  29. Homermaype

    when will cialis be over the counter tadalafil buy 36 hour cialis without prescription

  30. Homermaype

    comprar cialis online cocaine cialis purchase original cialis

  31. Homermaype

    cialis daily cheap cialis how much is a cialis

  32. Homermaype

    cheap cialis online which is better viagra cialis or levitra buy cialis canada

  33. StromLiset

    stromectol uk ivermectin eye drops

  34. Ralphpycle

    cialis prescription assistance program tadalafil 20mg best price

  35. Stevenamoca

    https://drwithoutdoctorprescription.online/# pain meds without written prescription

  36. Cameronlar

    prescription drugs without doctor approval buy prescription drugs without doctor

  37. Cameronlar
  38. Stevenamoca

    https://drwithoutdoctorprescription.com/# ed meds online without prescription or membership

  39. MichaelMut

    viagra online usa when will viagra be generic

  40. BrandonFug

    buying viagra online buy viagra online canada

  41. MichaelMut

    п»їviagra pills п»їviagra pills

  42. BrandonFug

    generic viagra walmart viagra shop

  43. MichaelMut

    viagra for men viagra online usa

  44. BrandonFug

    buy viagra online canada viagra cost per pill

  45. MichaelMut

    viagra price order viagra online

  46. BrandonFug

    viagra amazon viagra cost per pill

  47. RaymondGon

    buy zithromax online cheap where to get zithromax

  48. Stephenrab

    https://amoxilforsale.best/# where can i buy amoxicillin over the counter uk

  49. RobertBOk

    how to get clomid australia clomid over the counter nz

  50. RaymondGon

    https://buylasix.icu/# lasix 100 mg

  51. AnthonyVon

    https://buynolvadex.store/# tamoxifen menopause

  52. Williamsturf

    lasix generic name furosemide

  53. RaymondGon
  54. RobertFok

    https://withoutprescription.store/# non prescription ed drugs

  55. RobertFok

    https://withoutprescription.store/# legal to buy prescription drugs from canada

  56. MichealOpilt

    neurontin 300 mg neurontin 300 mg tablet

  57. RobertFok

    https://cipro.best/# ciprofloxacin over the counter

  58. RobertFok

    https://withoutprescription.store/# best canadian online pharmacy

  59. MichealOpilt

    canadian drugstore online discount prescription drugs

  60. RobertFok

    https://diflucan.icu/# diflucan pill price

  61. RobertFok

    https://diflucan.icu/# diflucan 150 mg canada

  62. MichealOpilt
  63. RobertFok

    https://withoutprescription.store/# best ed pills non prescription

  64. Stevenjam
  65. Danielfex

    generic ivermectin order stromectol over the counter

  66. Stevenjam

    https://drugsonline.store/# viagra without a doctor prescription

  67. DanielZet
  68. Danielfex

    ed pills cheap herbal ed treatment

  69. Phillipbon

    ivermectin for guinea pig stromectol for humans for sale

  70. Phillipbon

    stromectol 12 mg tablets order stromectol over the counter

  71. Larrygal

    https://pharmacyizi.com/# cheap drugs online

  72. Jamesdaw

    buy ed pills online best ed treatments

  73. Larrygal
  74. Stevephasy

    ed pharmacy ed meds online without doctor prescription

  75. Douglasaxiop

    https://pharmacyizi.com/# errectile dysfunction

  76. Stevephasy

    medication for ed medicine for erectile

  77. GeraldDam

    pharmacy near me best canadian pharmacy

  78. Thomasabodo
  79. GeraldDam

    erectile dysfunction drug non prescription ed pills

  80. GeraldDam

    ed pills gnc herbal ed treatment

  81. Thomasabodo
  82. MatthewHex

    https://canadiandrugs.best/# how to get prescription drugs without doctor

  83. KeithJuP

    best pills for ed what are ed drugs

  84. GeraldDam

    sildenafil without a doctor’s prescription dog antibiotics without vet prescription

  85. Thomasabodo

    https://canadiandrugs.best/# prescription without a doctor’s prescription

  86. GeraldDam

    top online pharmacy canada drugs online

  87. ‏ozark ending

    Fantastic article post.Really looking forward to read more. Want more.

  88. Thomasabodo
  89. GeraldDam

    Coreg Theo-24 Cr

  90. KeithJuP

    how to get prescription drugs without doctor prescription drugs without doctor approval

  91. JeffreyBrupe

    https://stromectolbestprice.com/# ivermectin dosage for pigs

  92. JeffreyBrupe

    https://stromectolbestprice.com/# ivermectin for chickens dosage

  93. GeorgeFed

    http://stromectolbestprice.com/# what is ivermectin 3 mg used for

  94. GerardOxish

    https://drugsbestprice.com/# real viagra without a doctor prescription usa

  95. Michaelcop

    erectile dysfunction pills erectile dysfunction pills

  96. GerardOxish

    https://drugsbestprice.com/# cheap pills online

  97. Dustinthymn

    https://medrxfast.com/# pet antibiotics without vet prescription

  98. ThomasRoN

    https://medrxfast.com/# the canadian drugstore

  99. Dustinthymn

    https://medrxfast.com/# prescription without a doctor’s prescription

  100. Dustinthymn

    https://medrxfast.com/# tadalafil without a doctor’s prescription

  101. ThomasRoN

    https://medrxfast.com/# buy prescription drugs online

  102. MichaelTon

    canadian online pharmacy prescription drugs

  103. Dustinthymn

    https://medrxfast.com/# prescription drugs online without doctor

  104. Dustinthymn

    https://medrxfast.com/# comfortis without vet prescription

  105. Dustinthymn

    https://medrxfast.com/# non prescription erection pills

  106. ThomasRoN

    https://medrxfast.com/# carprofen without vet prescription

  107. Dustinthymn

    https://medrxfast.com/# how to get prescription drugs without doctor

  108. Dustinthymn

    https://medrxfast.com/# prescription drugs

  109. ThomasRoN

    https://medrxfast.com/# canadian pharmacy online

  110. Dustinthymn

    https://medrxfast.com/# non prescription ed drugs


Leave a Reply

Your email address will not be published. Required fields are marked *