ilmenit Posted November 16, 2021 Share Posted November 16, 2021 (edited) 14 hours ago, zbyti said: Interesting: count: 10 repeat count [write/line count: 10 - count] write/line "end" In REBOL: REBOL [] count: 10 loop count [print count: 10 - count] print "end" it gives the same result: 0 10 0 10 0 10 0 10 0 10 end This is also a good example why we do need documentation (or at least description of differences from REBOL) for writing even basic code: In META repeat has different use/meaning than in REBOL In META write has different use/meaning than in REBOL Edited November 16, 2021 by ilmenit Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 16, 2021 Share Posted November 16, 2021 (edited) I still don't get it 10 - 10 = 0 // OK 0 - 10 = 10 // it's new to me In 8-bit world a expect rather 246. Edited November 16, 2021 by zbyti Quote Link to comment Share on other sites More sharing options...
ilmenit Posted November 16, 2021 Share Posted November 16, 2021 13 hours ago, zbyti said: the first produces 0 and 1000 alternately (which I don't understand), and the second of course 0. in Meta repeat behaves like loop in Rebol, and the parameter count ONLY tells how many times the following block will be evaluated, where the count parameter seems to be evaluated only once, not after each loop iteration. Take a look at the differences between loop, repeat and for in Loop functions sections of https://www.cis.upenn.edu/~matuszek/Concise Guides/Concise Rebol.html I do not know the reason why loop exists in this language as a dedicated keyword (sorry, Rebol has no keywords, it's a "control function" ). Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 16, 2021 Share Posted November 16, 2021 count: 10 repeat count [write/line count: count - 1] write/line "end" this acts as I expected. I know count its not a repeat counter. Seems 0-x = x. Quote Link to comment Share on other sites More sharing options...
ilmenit Posted November 16, 2021 Share Posted November 16, 2021 (edited) 25 minutes ago, zbyti said: I still don't get it 10 - 10 = 0 // OK 0 - 10 = 10 // it's new to me In 8-bit world a expect rather 246. This is not how it works. 10-10 is 0 there is no 0-10 in your example, there is always count = 10-count, so it's either 10-0 or 10-10, depending if count is 0 or 10. Here is the equivalent in C /* count: 10 repeat count [write/line count: 10 - count] write/line "end" */ #include <stdio.h> int main() { int count = 10; // loop count [] will only tell how many times execute the block int times = count; // evaluated only once for (int loop = 0; loop < times; ++loop) { count = 10 - count; printf("%d\n", count); } printf("end"); } that gives: 0 10 0 10 0 10 0 10 0 10 end Edited November 16, 2021 by ilmenit 2 Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 16, 2021 Share Posted November 16, 2021 (edited) Yes, you are right var count, i :byte; begin count := 10; for i := count downto 1 do begin count := 10 - count; writeln(count); end; end. give the same result. Edited November 16, 2021 by zbyti 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 16, 2021 Share Posted November 16, 2021 seems to be a serious dimness on my part Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 16, 2021 Share Posted November 16, 2021 (edited) var count, i :byte; begin count := 10; for i := count downto 1 do begin count := count - 10; writeln(count); end; end. 0 246 236 226 216 206 196 186 176 166 Again, I was sure I was write something else Edited November 16, 2021 by zbyti Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 16, 2021 Share Posted November 16, 2021 (edited) I can't explain why I was so sure what I wrote even looking at different code: count: 10 repeat count [write/line count: count - 10] write/line "end" Edited November 16, 2021 by zbyti 1 Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 16, 2021 Author Share Posted November 16, 2021 You can use DECREMENT COUNT to make it clearer, but it will have a different effect. 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 16, 2021 Share Posted November 16, 2021 Ok. No more programming for me... I swap my profession to baking donuts. I see things... 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted November 16, 2021 Share Posted November 16, 2021 Please, noooo!!! We need you! When I come back to programming I will surely need you. 1 1 Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 16, 2021 Author Share Posted November 16, 2021 (edited) 7 hours ago, ilmenit said: curl: (60) SSL certificate problem: unable to get local issuer certificate 7 hours ago, ilmenit said: I tried to use the compile.ape with curl.exe to compile a sample program, however with "Result is in file program.xex" there is no program.xex in the current directory. Any hints? https://language.metaproject.frl/#Windows Edited November 16, 2021 by Kaj de Vos Fixed link 1 Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 16, 2021 Author Share Posted November 16, 2021 3 hours ago, ilmenit said: Maybe less time consuming would be pointing the differences from REBOL? 14 hours ago, Kaj de Vos said: I have a solution in the works for conversion from REBOL. Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 16, 2021 Author Share Posted November 16, 2021 15 hours ago, zbyti said: ping atari8.metaproject.frl ping: atari8.metaproject.frl: Temporary failure in name resolution this makes it difficult to play with. I wanted to write something more in Meta. You can add atari8.metaproject.frl to your /etc/hosts file. That will make your DNS reliable for you. Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 16, 2021 Author Share Posted November 16, 2021 Thanks for trying Meta! It's really cool to see someone else using my language, especially on Atari. 1 Quote Link to comment Share on other sites More sharing options...
ilmenit Posted November 16, 2021 Share Posted November 16, 2021 (edited) 29 minutes ago, Kaj de Vos said: Thanks for trying Meta! It's really cool to see someone else using my language, especially on Atari. A very basic feature we are waiting for is ability to set some (preferably defined) memory array on an aligned memory location, and getting a 16bit pointer to it, so we can create a display list, screen memory and show some PMG ? Edited November 16, 2021 by ilmenit Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 16, 2021 Author Share Posted November 16, 2021 Again, no pointers, but you can always get around it with little snippets of integrated assembly, so no need to wait. Quote Link to comment Share on other sites More sharing options...
ilmenit Posted November 16, 2021 Share Posted November 16, 2021 (edited) 18 minutes ago, Kaj de Vos said: Again, no pointers, but you can always get around it with little snippets of integrated assembly, so no need to wait. Could you give an example how to do it? In the most basic case we need to: 1. Reserve some aligned (to $800) memory location for PMG, but making sure that it won't be overwritten by the program code and data. From DeRe "The pointer to the beginning of the player-missile area is labelled PMBASE. Because of internal limitations of ANTIC, PMBASE must be on a 2K address boundary for single-line resolution, or a 1K address boundary for double-line resolution.". 2. Set the PMBASE ($D407) to this aligned memory location (PMBASE= ~D407, from rainbow example, but still we need address of this reserved memory) 3. If possible, having this memory predefined with data, without need to copy of data to this location (something like binary inclusion or Bin2C approach to transform binary to the language array). Edited November 16, 2021 by ilmenit Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 16, 2021 Author Share Posted November 16, 2021 19 hours ago, Kaj de Vos said: Then you can do unsafe!!! [ LDA byte STA/via SAVMSC ] What you call basic and simple is actually a complex challenge. Examples will come in due time. Quote Link to comment Share on other sites More sharing options...
ilmenit Posted November 16, 2021 Share Posted November 16, 2021 (edited) 8 minutes ago, Kaj de Vos said: What you call basic and simple is actually a complex challenge. Examples will come in due time. Sure, I understand. By basic I mean here the basic use cases for 8bit Atari programming: - using PMG - using Display lists and Screen memory - using custom fonts for text-modes - having an excluded window in the middle of Atari memory ($4000-$8000) for banked memory Without having it covered it's hard to come up with other program than one that is printing some text and values in the default text screen. Edited November 16, 2021 by ilmenit Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 16, 2021 Author Share Posted November 16, 2021 Yes and no. I know all those use cases and have wanted for decades to make nice REBOL abstractions for them, even though they are very low-level. As Carl Sassenrath says, it is very hard to make things simple. Those abstractions simplify things and make them much more readable, but they take a lot of time to design and create. That's why I also wanted the PL65 way of enabling everything right away through integrated assembly. You can do anything you want, but the nicer abstractions will come slowly over time. Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted November 16, 2021 Share Posted November 16, 2021 36 minutes ago, Kaj de Vos said: Then you can do unsafe!!! [ LDA byte STA/via SAVMSC ] and this does not align with "Human Readable" it requires some knowledge of assembler Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 16, 2021 Author Share Posted November 16, 2021 Comparing it with other assemblers may bring some enlightenment. Quote Link to comment Share on other sites More sharing options...
ilmenit Posted November 16, 2021 Share Posted November 16, 2021 12 minutes ago, Kaj de Vos said: That's why I also wanted the PL65 way of enabling everything right away through integrated assembly. You can do anything you want, but the nicer abstractions will come slowly over time. This is a good idea. Still integrated assembly may not solve all the issues that e.g. linker in C language is resolving (placement of symbolic addresses as numeric addresses in the memory). Also if Meta is going to address different platforms (even for 6502) then they may have different loaders (e.g. on Atari it's common that programs are split into multiple segments, on C64 programs have only one segment, and when compiled as cart images the output is made of cartridge memory banks). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.