2

I'm building a model to display a UI using SDL2 on Rebol3.

So far, I'd like to do something like this:

gui: copy []
append gui context [style: 'h1 at: 10x30 text: "Hello World!" font: arial]

but should I use Object! when I only need a Block! like this:

gui: copy []
append/only gui reduce/no-set [style: 'h1 at: 10x30 text: "Hello World!" font: arial]

What's your opinion on this? What is best to use? Any other suggestion?

draegtun
  • 22,441
  • 5
  • 48
  • 71
GregP
  • 85
  • 6
  • I think the key of "why dialect" (as suggested by @rebolek) is mostly because when you do your specifications as objects in this form, it really could be done in any language. You're not playing to the strengths of the medium. That doesn't mean it's bad to do, it just makes whatever it is you are doing kind of unremarkable...and someone with JSON or QML or similar will have a solution that looks just like it. Of course, speaking of forks and [difference for the sake of difference](http://files.abovetopsecret.com/files/img/rl52152b96.jpg)... – HostileFork says dont trust SE Mar 11 '15 at 12:59

1 Answers1

3

Why not dialect?

[h1 10x30 "Hello World!" font arial]

Internally I would store it as an object!, because it provides you with an easier manipulation.

rebolek
  • 1,281
  • 7
  • 16
  • Yes, dialect is very user friendly but that's really something to add on the top. Then the dialect has to be translated into objects or blocks or whatever. And that is this part I'm thinking about for now. Both can be manipulated the same way for example: widget/style – GregP Mar 10 '15 at 17:23
  • They can both be manipulated in similar way, but what you need is really an object. You can mess up block much easily, remove something, add duplicate field etc... You would need to make your own manipulation functions to be sure everything will work fine and why do that, when you just can use an object? – rebolek Mar 11 '15 at 05:54
  • I was wondering to be as much savvy as possible in terms of memory and and speed performances but I realize this is not keeping things simple and I agree using Object! is the most natural way. In fact, using Gob! would even make more sense but you can't set any field to a Gob!, for example I need a style attribute or an on-click or an on-over and this can only be set to the data Gob! attribute. This is now another question: Object! vs Gob!. – GregP Mar 11 '15 at 08:12