Информация об изменениях

Сообщение Re[2]: Boo от 21.09.2020 2:15

Изменено 21.09.2020 2:17 Разраб

Re[2]: Boo
Здравствуйте, Kolesiki, Вы писали:

AA>>Обратил тут внимание на еще один ЯП


K>Ты так и будешь нас радовать своими детскими открытиями или просто тупо свернёшься в личный бложик?


Хорошо, но оставлю это здесь

.NET 5 is the future

Что как бы намекает...

А вот это появилось в коре совсем недавно при помощи

import Boo.Lang.Compiler
import Boo.Lang.Compiler.Ast
import System
class TraceAttribute(AbstractAstAttribute):
  def Apply(type as Node):
    target = type as ClassDefinition
    if target is null:
      raise ArgumentException(
        "TraceAttribute can only be applied to classes.",
        "type")
    for member in target.Members:
      method = member as Method
      continue if method is null
      method.Body = [|
        Console.Out.WriteLine(string.Format(
          "Method {0} started.", $(method.FullName)))
        $(method.Body)
          Console.Out.WriteLine(string.Format(
          "Method {0} finished.", $(method.FullName)))
      |]
Re[2]: Boo
Здравствуйте, Kolesiki, Вы писали:

AA>>Обратил тут внимание на еще один ЯП


K>Ты так и будешь нас радовать своими детскими открытиями или просто тупо свернёшься в личный бложик?


Хорошо, но оставлю это здесь

.NET 5 is the future

Что как бы намекает...

А вот это появилось в коре совсем недавно, а в бу уже сто лет имеется

import Boo.Lang.Compiler
import Boo.Lang.Compiler.Ast
import System
class TraceAttribute(AbstractAstAttribute):
  def Apply(type as Node):
    target = type as ClassDefinition
    if target is null:
      raise ArgumentException(
        "TraceAttribute can only be applied to classes.",
        "type")
    for member in target.Members:
      method = member as Method
      continue if method is null
      method.Body = [|
        Console.Out.WriteLine(string.Format(
          "Method {0} started.", $(method.FullName)))
        $(method.Body)
          Console.Out.WriteLine(string.Format(
          "Method {0} finished.", $(method.FullName)))
      |]